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

Add a way to sync a stack from the remote without pushing

Abierto
#516 1 comentario 1 reacción 0 asignados Ver en GitHub

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
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
git, github, go
Área
cli

Línea de trabajo

Start with the existing gh stack sync command and trace how it fetches, rebases, and pushes stack branches. Compare that flow with the documented git fetch --all --prune and branch-reset sequence. Done means a sync mode or command updates local stack branches from their remotes without rebasing, pushing, or creating duplicate commits.

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

Descripción

When a stack has been restacked and force-pushed from elsewhere either by a collaborator, or the rebase option on gh webapp my local branches are left with the pre-rebase SHAs. With stack view every branch shows as ahead N, behind N against its remote, but the "ahead" commits are just stale copies of work that's already upstream under different hashes.

What I want in that situation is "make my local stack match the remote". as far as I am aware gh stack sync is close to doing this, but it always pushes (--force-with-lease --atomic), which is the opposite direction, and there's no flag to stop it.

It also doesn't just no-op, it rebases those stale local commits onto the updated parents, which replays commits that are already upstream. I ended up with empty duplicate commits on a branch that way, including one that kept its original co-authors on a no-op.

So what I end up doing when I want my local to match the remote stack is:

git fetch --all --prune
for every stack branch git branch -f "$branch" "origin/$b"

I think a good solution would be either a flag on sync (--no-push, or a --reset/--from-remote mode) or a separate
command, that fetches and points each local stack branch at its remote without rebasing or pushing anything. You could even have sync detect this case where local is ahead only by commits whose patch-id already exists upstream rather than directly with a flag.

Lenguaje dominante
Go
Estrellas
1.5k
Forks
73
Merge medio
1 d 8 h
PR fusionados (30 d)
7

Guía de contribución

Abrir la guía de contribución

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 github/gh-stack

Todos los issues de github/gh-stack

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.