Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

git: git_create_branch cannot create a branch from a detached HEAD

Ouverte
#5,192 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
68/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
git, typescript
Domaine
devtools

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
TypeScript
Étoiles
91.6k
Forks
11.9k
Merge moyen
6 h 37 min
PR mergées (30 j)
147

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de modelcontextprotocol/servers

Toutes les issues de modelcontextprotocol/servers

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.