Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Master advanced Git techniques to maintain clean history, collaborate effectively, and recover from any situation with confidence.
.claude/skills/sickn33-git-advanced-workflows/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 140% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 191% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 108% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 356% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 280% | 0% |
Master advanced Git techniques to maintain clean history, collaborate effectively, and recover from any situation with confidence.
Interactive rebase is the Swiss Army knife of Git history editing.
Common Operations:
pick: Keep commit as-isreword: Change commit messageedit: Amend commit contentsquash: Combine with previous commitfixup: Like squash but discard messagedrop: Remove commit entirelyBasic Usage:
bash# Rebase last 5 commits git rebase -i HEAD~5 # Rebase all commits on current branch git rebase -i $(git merge-base HEAD main) # Rebase onto specific commit git rebase -i abc123
Apply specific commits from one branch to another without merging entire branches.
bash# Cherry-pick single commit git cherry-pick abc123 # Cherry-pick range of commits (exclusive start) git cherry-pick abc123..def456 # Cherry-pick without committing (stage changes only) git cherry-pick -n abc123 # Cherry-pick and edit commit message git cherry-pick -e abc123
Binary search through commit history to find the commit that introduced a bug.
bash# Start bisect git bisect start # Mark current commit as bad git bisect bad # Mark known good commit git bisect good v1.0.0 # Git will checkout middle commit - test it # Then mark as good or bad git bisect good # or: git bisect bad # Continue until bug found # When done git bisect reset
Automated Bisect:
bash# Use script to test automatically git bisect start HEAD v1.0.0 git bisect run ./test.sh # test.sh should exit 0 for good, 1-127 (except 125) for bad
Work on multiple branches simultaneously without stashing or switching.
bash# List existing worktrees git worktree list # Add new worktree for feature branch git worktree add ../project-feature feature/new-feature # Add worktree and create new branch git worktree add -b bugfix/urgent ../project-hotfix main # Remove worktree git worktree remove ../project-feature # Prune stale worktrees git worktree prune
Your safety net - tracks all ref movements, even deleted commits.
bash# View reflog git reflog # View reflog for specific branch git reflog show feature/branch # Restore deleted commit git reflog # Find commit hash git checkout abc123 git branch recovered-branch # Restore deleted branch git reflog git branch deleted-branch abc123
bash# Start with feature branch git checkout feature/user-auth # Interactive rebase to clean history git rebase -i main # Example rebase operations: # - Squash "fix typo" commits # - Reword commit messages for clarity # - Reorder commits logically # - Drop unnecessary commits # Force push cleaned branch (safe if no one else is using it) git push --force-with-lease origin feature/user-auth
bash# Create fix on main git checkout main git commit -m "fix: critical security patch" # Apply to release branches git checkout release/2.0 git cherry-pick abc123 git checkout release/1.9 git cherry-pick abc123 # Handle conflicts if they arise git cherry-pick --continue # or git cherry-pick --abort
bash# Start bisect git bisect start git bisect bad HEAD git bisect good v2.1.0 # Git checks out middle commit - run tests npm test # If tests fail git bisect bad # If tests pass git bisect good # Git will automatically checkout next commit to test # Repeat until bug found # Automated version git bisect start HEAD v2.1.0 git bisect run npm test
bash# Main project directory cd ~/projects/myapp # Create worktree for urgent bugfix git worktree add ../myapp-hotfix hotfix/critical-bug # Work on hotfix in separate directory cd ../myapp-hotfix # Make changes, commit git commit -m "fix: resolve critical bug" git push origin hotfix/critical-bug # Return to main work without interruption cd ~/projects/myapp git fetch origin git cherry-pick hotfix/critical-bug # Clean up when done git worktree remove ../myapp-hotfix
bash# Accidentally reset to wrong commit git reset --hard HEAD~5 # Oh no! # Use reflog to find lost commits git reflog # Output shows: # abc123 HEAD@{0}: reset: moving to HEAD~5 # def456 HEAD@{1}: commit: my important changes # Recover lost commits git reset --hard def456 # Or create branch from lost commit git branch recovery def456
When to Rebase:
When to Merge:
bash# Update feature branch with main changes (rebase) git checkout feature/my-feature git fetch origin git rebase origin/main # Handle conflicts git status # Fix conflicts in files git add . git rebase --continue # Or merge instead git merge origin/main
Automatically squash fixup commits during rebase.
bash# Make initial commit git commit -m "feat: add user authentication" # Later, fix something in that commit # Stage changes git commit --fixup HEAD # or specify commit hash # Make more changes git commit --fixup abc123 # Rebase with autosquash git rebase -i --autosquash main # Git automatically marks fixup commits
Break one commit into multiple logical commits.
bash# Start interactive rebase git rebase -i HEAD~3 # Mark commit to split with 'edit' # Git will stop at that commit # Reset commit but keep changes git reset HEAD^ # Stage and commit in logical chunks git add file1.py git commit -m "feat: add validation" git add file2.py git commit -m "feat: add error handling" # Continue rebase git rebase --continue
Cherry-pick only specific files from a commit.
bash# Show files in commit git show --name-only abc123 # Checkout specific files from commit git checkout abc123 -- path/to/file1.py path/to/file2.py # Stage and commit git commit -m "cherry-pick: apply specific changes from abc123"
bash# Safe force push git push --force-with-lease origin feature/branch # Create backup before risky operation git branch backup-branch git rebase -i main # If something goes wrong git reset --hard backup-branch
bash# Abort operations in progress git rebase --abort git merge --abort git cherry-pick --abort git bisect reset # Restore file to version from specific commit git restore --source=abc123 path/to/file # Undo last commit but keep changes git reset --soft HEAD^ # Undo last commit and discard changes git reset --hard HEAD^ # Recover deleted branch (within 90 days) git reflog git branch recovered-branch abc123
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 9,972 | 19,050 | +91% | 1 | 1 | 0% | 1,744 | 3,634 | +108% | 0 | 0 | — |
case-02 | fail→pass | 7,318 | 5,424 | -26% | 1 | 1 | 0% | 1,390 | 3,335 | +140% | 0 | 0 | — |
case-03 | pass→pass | 4,037 | 4,836 | +20% | 1 | 1 | 0% | 692 | 3,156 | +356% | 0 | 0 | — |
case-04 | pass→pass | 4,777 | 3,562 | -25% | 1 | 1 | 0% | 780 | 2,962 | +280% | 0 | 0 | — |
case-05 | pass→pass | 5,556 | 4,330 | -22% | 1 | 1 | 0% | 1,118 | 3,104 | +178% | 0 | 0 | — |
case-06 | pass→pass | 2,541 | 3,147 | +24% | 1 | 1 | 0% | 480 | 2,796 | +483% | 0 | 0 | — |
case-07 | fail→pass | 5,941 | 5,397 | -9% | 1 | 1 | 0% | 1,135 | 3,298 | +191% | 0 | 0 | — |
case-08 | pass→pass | 5,942 | 5,177 | -13% | 1 | 1 | 0% | 1,036 | 3,285 | +217% | 0 | 0 | — |
case-09 | pass→pass | 3,844 | 2,996 | -22% | 1 | 1 | 0% | 681 | 2,894 | +325% | 0 | 0 | — |
case-10 | pass→pass | 5,456 | 2,748 | -50% | 1 | 1 | 0% | 914 | 2,800 | +206% | 0 | 0 | — |
case-11 | pass→pass | 8,574 | 8,059 | -6% | 1 | 1 | 0% | 1,419 | 3,692 | +160% | 0 | 0 | — |
case-12 | pass→pass | 8,122 | 6,375 | -22% | 1 | 1 | 0% | 1,403 | 3,441 | +145% | 0 | 0 | — |
case-13 | pass→pass | 7,349 | 2,839 | -61% | 1 | 1 | 0% | 1,307 | 2,867 | +119% | 0 | 0 | — |
case-14 | pass→pass | 11,550 | 7,934 | -31% | 1 | 1 | 0% | 1,923 | 3,593 | +87% | 0 | 0 | — |
case-15 | pass→pass | 6,363 | 4,089 | -36% | 1 | 1 | 0% | 1,068 | 3,065 | +187% | 0 | 0 | — |
case-16 | pass→pass | 10,532 | 7,893 | -25% | 1 | 1 | 0% | 1,812 | 3,688 | +104% | 0 | 0 | — |
case-17 | pass→pass | 5,064 | 2,670 | -47% | 1 | 1 | 0% | 917 | 2,799 | +205% | 0 | 0 | — |
case-18 | pass→pass | 4,656 | 2,957 | -36% | 1 | 1 | 0% | 858 | 2,804 | +227% | 0 | 0 | — |
case-19 | pass→pass | 8,741 | 5,654 | -35% | 1 | 1 | 0% | 1,759 | 3,415 | +94% | 0 | 0 | — |
case-20 | pass→pass | 4,948 | 4,023 | -19% | 1 | 1 | 0% | 907 | 3,033 | +234% | 0 | 0 | — |
case-21 | pass→pass | 10,539 | 10,519 | -0% | 1 | 1 | 0% | 1,891 | 4,220 | +123% | 0 | 0 | — |
case-22 | pass→pass | 4,346 | 3,091 | -29% | 1 | 1 | 0% | 739 | 2,853 | +286% | 0 | 0 | — |
case-23 | pass→pass | 6,594 | 6,809 | +3% | 1 | 1 | 0% | 1,232 | 3,621 | +194% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.