gut rescue¶
Diagnoses and fixes the most common Git problems through an interactive menu.
Usage¶
Running gut rescue with no subcommand performs a full health check.
Subcommands¶
| Subcommand | Description |
|---|---|
| (none) | Full repository health check |
detached |
Fix detached HEAD state interactively |
conflicts |
Walk through unresolved merge conflicts |
lost |
Browse the reflog to find lost commits |
rebase |
Abort, skip, or continue a stuck rebase |
stash |
Apply, pop, or inspect saved stashes |
init |
Initialize a new repository (safe if already a repo) |
Health Check¶
Runs a series of checks and reports:
- Current branch
- Detached HEAD status
- Uncommitted changes
- Unresolved merge conflicts
- In-progress rebase
- Remote
originconfiguration
Subcommand Details¶
detached¶
Triggered when HEAD points to a commit rather than a branch. Offers:
- Create a new branch here saves your work to a named branch
- Switch to an existing branch abandons the detached state (unstaged changes may be lost)
conflicts¶
Lists all files with unresolved merge conflict markers and walks you through resolving them:
- Open each file and look for
<<<<<<<,=======,>>>>>>>markers. - Edit the file, keeping the changes you want.
- Run
gut save <file>to mark the file as resolved. - Run
gut saveto complete the merge.
Or, to abort: gut git merge --abort
lost¶
Shows the 20 most recent reflog entries with timestamps, so you can find commits that appear "gone" after a reset or accidental branch deletion. Explains how to recover via gut branch new + cherry-pick.
rebase¶
If a rebase is in progress, offers:
- Abort returns the repository to the state before the rebase started
- Skip skips the current commit and continues
- Continue resumes after you've resolved conflicts
stash¶
Lists all saved stashes and offers:
- Apply most recent stash (keeps it in the list)
- Pop most recent stash (removes it from the list)
- Show stash contents
init¶
Initialises a new Git repository in the current directory. Safe to run if you're already in a repo it will warn you.
See Also¶
gut whoopsjump to a past state via refloggut stashmanage stashed workgut integratemerge branches with conflict guidance