| name | git-advanced |
| description | Advanced git operations — bisect, worktree, stash, cherry-pick, rebase, submodules, and more. Use for complex git workflows beyond basic add/commit/push. |
| metadata | {"ccbot":{"emoji":"🌿","requires":{"bins":["git"]}}} |
Git Advanced Skill
Use git via the Bash tool. Use gh CLI for GitHub-specific actions (see github skill).
Worktrees (parallel branches without switching)
git worktree add ../feature-login feature/login
cd ../feature-login
git worktree list
git worktree remove ../feature-login
Stash
git stash push -m "WIP: auth refactor"
git stash list
git stash pop
git stash apply stash@{2}
git stash drop stash@{0}
git stash show -p stash@{0}
Interactive Rebase
git rebase -i HEAD~5
git rebase -i main
git rebase --abort
git rebase --continue
Cherry-Pick
git cherry-pick abc1234
git cherry-pick abc1234..def5678
git cherry-pick -n abc1234
git cherry-pick --abort
Bisect (find bug-introducing commit)
git bisect start
git bisect bad
git bisect good v1.2.0
git bisect good
git bisect reset
Submodules
git submodule add https://github.com/owner/lib.git libs/lib
git submodule update --init --recursive
git submodule update --remote
git submodule foreach git pull
Find & Inspect
git log --oneline --grep="fix: auth"
git log -S "function authenticate" --oneline
git blame -L 42,55 src/auth.py
git show abc1234 --stat
git show abc1234 -- src/auth.py
git diff main..feature/login -- src/
Undo & Fix
git reset --soft HEAD~1
git reset HEAD~1
git checkout -- src/config.py
git reflog | grep "branch-name"
git checkout -b branch-name abc1234
git revert abc1234
Cleanup
git branch --merged main | grep -v "^\* " | xargs git branch -d
git remote prune origin
git clean -nd
git clean -fd
Log Formatting
git log --oneline --graph --decorate --all
git log --since="2 weeks ago" --author="Alice"
git log --format="%h %ad %s" --date=short
Tips
- Always
git stash before switching branches with dirty state.
- Use worktrees instead of multiple clones for parallel work.
- Prefer
git revert over git reset for shared/pushed commits.
git reflog is your safety net — commits are recoverable for ~30 days.