Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

git: git_create_branch cannot create a branch from a detached HEAD

Cerrado
#5,192 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
git, typescript
Área
devtools

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
91.6k
Forks
11.9k
Merge medio
5 h 18 min
PR fusionados (30 d)
185

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de modelcontextprotocol/servers

Todos los issues de modelcontextprotocol/servers

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.