gg sc
Squash local changes into the current stack commit.
gg sc [OPTIONS]
Options
-a, --all: Include staged and unstaged changes--staged-only: Include staged changes only and ignoredefaults.unstaged_action. Unstaged and untracked files are never staged or stashed. Conflicts with--all. A mid-stack amend refuses before mutation when tracked changes are unstaged or any untracked files are present, since either can prevent rebasing descendants safely.-f, --force(alias--ignore-immutable): Override the immutability guard. By defaultgg screfuses to amend a commit whose PR is merged or which is already reachable fromorigin/<base>. See Core concepts · Immutable commits.
When unstaged changes are present, behavior is controlled by defaults.unstaged_action in .git/gg/config.json:
ask(default): prompt to stage all, stash, continue, or abortadd: auto-stage all changes (git add -A) and continuestash: auto-stash and continuecontinue: continue without including unstaged changesabort: fail immediately
Examples
# Standard amend-like flow
git add .
gg sc
# Include unstaged changes too
gg sc --all
# Native-client flow: amend only the prepared index
gg sc --staged-only