Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Add --rebase-on-conflict flag to `gh stack sync` to auto-run rebase on conflicts

Offen
#431 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@skarim arbeitet bereits daran.

Seit 11.8.2026.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

feature request topic: cli - sync

Summary

Add a flag to gh stack sync so that when a conflict is detected it automatically runs gh stack rebase (instead of instructing the user to run rebase manually).

Background / motivation

Currently when users run gh stack sync and it encounters a conflict the CLI prints an instruction to run gh stack rebase. Some users would prefer a single-command flow that attempts a rebase automatically when a conflict occurs to avoid typing two commands.

Proposed behavior

  • Add an explicit flag to gh stack sync, for example --rebase-on-conflict (alternative names: --rebase-if-conflict, --auto-rebase).
  • Default behavior of gh stack sync remains unchanged (safe, no automatic rebase).
  • When the flag is provided and sync detects a conflict, gh stack sync should automatically invoke the rebase flow (equivalent to running gh stack rebase).
  • The flag signals that the user consents to the potential rebase-related outcomes (e.g., temporary detached HEAD during an in-progress rebase), so the command can proceed without an additional prompt.
  • The command should preserve non-interactive behavior where appropriate (i.e., suitable for scripts). If prompts are required during rebase, consider a complementary --yes or --no-interactive option, or clearly document the interaction expectations.

Acceptance criteria

  • gh stack sync --rebase-on-conflict will run a rebase automatically if a conflict is encountered during sync.
  • The default gh stack sync remains unchanged and does not perform automatic rebases.
  • Documentation for gh stack sync includes the new flag and describes its behavior and risks.

Example

  • Normal: gh stack sync
  • With flag: gh stack sync --rebase-on-conflict

Notes / implementation hints

  • Consider the exact flag name and whether a short alias (e.g., -r) is appropriate.
  • Ensure the UX communicates that the user opted in to automatic rebase behavior and any potential consequences.
  • Make sure the behavior is deterministic for CI/automation usage (document or provide an explicit non-interactive mode).

View original Slack conversation

Vorherrschende Sprache
Go
Sterne
1.5k
Forks
73
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
7

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus github/gh-stack

Alle Issues in github/gh-stack

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.