Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

git: git_create_branch cannot create a branch from a detached HEAD

Aperta
#5,192 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
git, typescript
Ambito
devtools

Direzione di ricerca

Start in src/git/src/mcp_server_git/server.py at git_create_branch and trace how it handles a detached HEAD and resolves base_branch; the issue cites #4955 as a prototype. Reproduce on a detached commit, then verify the branch is created from that commit and the reply names its SHA, or that a commit-ish is accepted while a leading - is rejected.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug server-git v2
Problem

git_create_branch in src/git/src/mcp_server_git/server.py refuses to branch from a detached HEAD when no base_branch is given, and tells the caller to pass base_branch. But base_branch is looked up among the repository's references, so passing a commit SHA fails too. A branch therefore cannot be created at a detached commit unless a ref already points there, which blocks the ordinary git switch -c <name> way of keeping work done on a detached HEAD. Reproduced on v2/main.

Expected

On a detached HEAD with no base_branch, branch from the current commit and name the SHA in the reply, or accept a commit-ish for base_branch (still rejecting a leading -).

Prior work
  • #4955 by @kabishou11

The PR(s) above targeted the pre-refactor code and are closed as part of the backlog triage in #4875; this issue is where the work continues, with the PR(s) as a prototype. Thank you to their authors.

Lingua principale
TypeScript
Stelle
91.6k
Fork
11.9k
Merge medio
6h 37m
PR unite (30g)
147

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/servers

Tutte le issue di modelcontextprotocol/servers

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.