Commands¶
This reference is auto-generated from the command registry in cmd/command/. Do not edit this file by hand; run make docs.
For quick lookup, ggc help lists every command and ggc help <command> shows the same detail in your terminal.
Table of contents¶
Basics¶
ggc add¶
Stage changes for the next commit.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
add . |
Add all changes to the index |
add <file> |
Add a specific file to the index |
add interactive |
Add changes interactively |
add patch |
Add changes interactively (patch mode) |
Examples:
ggc add file.txt # Add a specific file
ggc add . # Add all changes to index
ggc add interactive # Add changes interactively
ggc add patch # Add changes interactively (patch mode)
ggc help¶
Show help information for commands.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
help |
Show main help message |
help <command> |
Show help for a specific command |
Examples:
ggc reset¶
Reset current HEAD to the specified state.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
reset |
Hard reset to origin/ |
reset hard <commit> |
Hard reset to specified commit |
reset soft <commit> |
Soft reset: move HEAD but keep changes staged |
Examples:
ggc reset # Hard reset to origin/<current-branch> and clean
ggc reset hard HEAD~1 # Hard reset to previous commit
ggc reset soft HEAD~1 # Soft reset: keep changes staged
ggc reset soft HEAD~3 # Soft reset 3 commits, keeping changes staged
Branch¶
ggc branch¶
List, create, and manage branches.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
branch checkout |
Switch to an existing branch |
branch checkout remote |
Create and checkout a local branch from the remote |
branch contains <commit> |
Show branches containing a commit |
branch create |
Create and checkout a new branch |
branch current |
Show current branch name |
branch delete |
Delete local branch |
branch delete merged |
Delete local merged branch |
branch info <branch> |
Show detailed branch information |
branch list local |
List local branches |
branch list remote |
List remote branches |
branch list verbose |
Show detailed branch listing |
branch move <branch> <commit> |
Move branch to specified commit |
branch rename <old> <new> |
Rename a branch |
branch set upstream <branch> <upstream> |
Set upstream for a branch |
branch sort [date|name] |
List branches sorted by date or name |
Examples for branch delete:
ggc branch delete feature/123 # Delete a branch
ggc branch delete feature/123 --force # Force delete a branch
Examples:
ggc branch current # Show current branch
ggc branch checkout # Switch to an existing branch
ggc branch checkout remote # Create and checkout a local branch from the remote
ggc branch create feature/login # Create and checkout new branch
ggc branch delete feature/login # Delete local branch
ggc branch delete merged # Delete local merged branch
ggc branch rename old new # Rename a branch
ggc branch move feature abc123 # Move branch to specified commit
ggc branch set upstream feature origin/feature # Set upstream branch
ggc branch info feature # Show detailed branch information
ggc branch list verbose # Show detailed branch listing
ggc branch sort date # List branches sorted by date
ggc branch contains abc123 # Show branches containing a commit
Commit¶
ggc commit¶
Create commits from staged changes.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
commit <message> |
Create commit with a message |
commit allow empty |
Create an empty commit |
commit amend |
Amend previous commit (editor) |
commit amend no-edit |
Amend without editing commit message |
commit fixup <commit> |
Create a fixup commit targeting |
Examples:
ggc commit "Update docs" # Create commit with a message
ggc commit allow empty # Create an empty commit
ggc commit amend # Amend previous commit (editor)
ggc commit amend no-edit # Amend without editing commit message
ggc commit fixup abc1234 # Create a fixup commit targeting abc1234
ggc log¶
Inspect commit history.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
log graph |
Show log with graph |
log simple |
Show simple historical log |
Examples:
Remote¶
ggc fetch¶
Download objects and refs from remotes.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
fetch |
Fetch from the remote |
fetch prune |
Fetch and clean stale references |
Examples:
ggc pull¶
Fetch and integrate from the remote.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
pull current |
Pull current branch from remote repository |
pull rebase |
Pull and rebase |
Examples:
ggc push¶
Update remote branches.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
push current |
Push current branch to remote repository |
push force |
Force push current branch |
Examples:
ggc remote¶
Manage remotes.
Usage:
ggc remote list
ggc remote add <name> <url>
ggc remote remove <name>
ggc remote set-url <name> <url>
Subcommands:
| Subcommand | Description |
|---|---|
remote add <name> <url> |
Add remote repository |
remote list |
List all remote repositories |
remote remove <name> |
Remove remote repository |
remote set-url <name> <url> |
Change remote URL |
Examples:
Status¶
ggc status¶
Show working tree status.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
status |
Show working tree status |
status short |
Show concise status (porcelain format) |
Examples:
ggc status # Full detailed status output
ggc status short # Short, concise output (porcelain format)
Cleanup¶
ggc clean¶
Remove untracked files and directories.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
clean dirs |
Clean untracked directories |
clean files |
Clean untracked files |
clean interactive |
Clean files interactively |
Examples:
ggc clean files # Clean untracked files
ggc clean dirs # Clean untracked directories
ggc clean interactive # Clean files interactively
ggc restore¶
Restore files in working tree or staging area.
Usage:
ggc restore <file>
ggc restore .
ggc restore staged <file>
ggc restore staged .
ggc restore <commit> <file>
Subcommands:
| Subcommand | Description |
|---|---|
restore . |
Restore all files in working directory from index |
restore <commit> <file> |
Restore file from specific commit |
restore <file> |
Restore file in working directory from index |
restore staged . |
Unstage all files |
restore staged <file> |
Unstage file (restore from HEAD to index) |
Examples:
Diff¶
ggc diff¶
Inspect changes between commits, the index, and the working tree.
Usage:
ggc diff [staged|unstaged|head] [--stat|--name-only|--name-status] [<commit>|<commit1> <commit2>] [--] [<path>...]
Subcommands:
| Subcommand | Description |
|---|---|
diff |
Show changes (git diff HEAD) |
diff head |
Alias for default diff against HEAD |
diff staged |
Show staged changes |
diff unstaged |
Show unstaged changes |
Examples:
ggc diff --stat # Show staged + unstaged changes with summary
ggc diff staged cmd/diff.go # Diff staged changes for a file
ggc diff abc123 def456 # Compare two commits
ggc diff abc123 cmd/diff.go # Compare commit to working tree for a path
ggc diff -- cmd/deleted_file.go # Diff a path using -- for disambiguation
Tag¶
ggc tag¶
Create, list, and manage tags.
Usage:
ggc tag list
ggc tag annotated <tag> <message>
ggc tag delete <tag>
ggc tag show <tag>
ggc tag push [<remote> <tag>]
ggc tag create <tag>
Subcommands:
| Subcommand | Description |
|---|---|
tag annotated <tag> <message> |
Create annotated tag |
tag create <tag> |
Create tag |
tag delete <tag> |
Delete tag |
tag list |
List all tags |
tag push |
Push tags to remote |
tag show <tag> |
Show tag information |
Examples:
ggc tag # List all tags
ggc tag list # List all tags (sorted)
ggc tag list v1.* # List tags matching pattern
ggc tag create v1.0.0 # Create tag
ggc tag create v1.0.0 abc123 # Tag specific commit
ggc tag annotated v1.0.0 'Release notes' # Create annotated tag
ggc tag delete v1.0.0 # Delete tag
ggc tag push # Push all tags to origin
ggc tag push origin v1.0.0 # Push specific tag (remote first)
ggc tag show v1.0.0 # Show tag information
Config¶
ggc config¶
Get and set ggc configuration.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
config get <key> |
Get a specific config value |
config list |
List all configuration |
config set <key> <value> |
Set a configuration value |
Examples:
ggc config list # List all configuration values
ggc config get <key> # Get a config value by key path (e.g., 'ui.color')
ggc config set <key> <value> # Set a config value by key path
Hook¶
ggc hook¶
Manage Git hooks.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
hook disable <hook> |
Disable a hook |
hook edit <hook> |
Edit a hook's contents |
hook enable <hook> |
Enable a hook |
hook install <hook> |
Install a hook |
hook list |
List all hooks |
hook uninstall <hook> |
Uninstall an existing hook |
Examples:
ggc hook list # List all hooks and their status
ggc hook install <hook> # Install a hook
ggc hook enable <hook> # Make a hook executable
ggc hook disable <hook> # Make a hook non-executable
ggc hook uninstall <hook> # Remove a hook
ggc hook edit <hook> # Edit a hook
Rebase¶
ggc rebase¶
Reapply commits on top of another base tip.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
rebase <upstream> |
Rebase current branch onto |
rebase abort |
Abort an in-progress rebase |
rebase autosquash |
Interactive rebase with --autosquash |
rebase continue |
Continue an in-progress rebase |
rebase interactive |
Interactive rebase |
rebase skip |
Skip current patch and continue |
Examples:
ggc rebase interactive # Interactive rebase
ggc rebase autosquash # Interactive rebase with --autosquash
ggc rebase main # Rebase current branch onto 'main'
ggc rebase continue # Continue an in-progress rebase
ggc rebase abort # Abort an in-progress rebase
ggc rebase skip # Skip current patch and continue
Stash¶
ggc stash¶
Save and reapply work-in-progress changes.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
stash |
Stash current changes |
stash apply |
Apply stash without removing it |
stash apply <stash> |
Apply specific stash without removing it |
stash branch <branch> |
Create branch from stash |
stash branch <branch> <stash> |
Create branch from specific stash |
stash clear |
Remove all stashes |
stash create |
Create stash and return object name |
stash drop |
Remove the latest stash |
stash drop <stash> |
Remove specific stash |
stash list |
List all stashes |
stash pop |
Apply and remove the latest stash |
stash pop <stash> |
Apply and remove specific stash |
stash push |
Save changes to new stash |
stash push -m <message> |
Save changes to new stash with message |
stash save <message> |
Save changes to new stash with message |
stash show |
Show changes in stash |
stash show <stash> |
Show changes in specific stash |
stash store <object> |
Store stash object |
Examples:
ggc stash # Stash current changes
ggc stash list # List all stashes
ggc stash show [stash] # Show changes in stash
ggc stash apply [stash] # Apply stash without removing it
ggc stash pop [stash] # Apply and remove stash
ggc stash drop [stash] # Remove stash
ggc stash branch <branch> [stash] # Create branch from stash
ggc stash push [-m message] [files] # Save changes to new stash
ggc stash save [message] # Save changes to new stash
ggc stash clear # Remove all stashes
ggc stash create # Create stash and return object name
ggc stash store <object> # Store stash object
Utility¶
ggc completion¶
Print or install shell completion scripts.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
completion bash |
Print bash completion script |
completion fish |
Print fish completion script |
completion install <shell> |
Install the completion script for <bash |
completion zsh |
Print zsh completion script |
Examples:
ggc completion bash # Print the bash completion to stdout
ggc completion install zsh # Install zsh completion under ~/.zsh/completions/
ggc completion fish > ~/.config/fish/completions/ggc.fish
ggc debug-keys¶
Debug keybinding issues and capture raw key sequences.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
debug-keys |
Show current keybindings |
debug-keys raw |
Capture key sequences interactively |
debug-keys raw <file> |
Capture key sequences and save them to a file |
Examples:
ggc debug-keys # Show active keybindings
ggc debug-keys raw # Capture key sequences interactively
ggc debug-keys raw keys.txt # Capture and save to keys.txt
ggc doctor¶
Diagnose the local ggc installation.
Usage:
Examples:
ggc quit¶
Exit interactive mode.
Usage:
Examples:
ggc version¶
Display current ggc version.
Usage:
Subcommands:
| Subcommand | Description |
|---|---|
version json |
Emit the version information as a JSON document |
Examples: