| name | git-essentials |
| description | Expert Git workflow assistance for branching, merging, rebasing, conflict resolution, and history management. Use when working with Git operations beyond simple commits. |
| allowed-tools | ["Bash"] |
| tags | ["git","branching","merging","rebasing","conflicts","version-control","workflow"] |
| platforms | ["Claude","ChatGPT","Gemini"] |
| author | locusai |
Git Essentials
When to use this skill
- Creating and managing branches
- Resolving merge conflicts
- Rebasing and cleaning up history
- Cherry-picking commits
- Investigating history with git log/blame/bisect
- Recovering from mistakes (reset, revert, reflog)
Branching Strategy
Branch naming
feat/<issue>-<short-description>
fix/<issue>-<short-description>
chore/<short-description>
release/<version>
hotfix/<issue>-<description>
Common workflows
git checkout main && git pull
git checkout -b feat/123-add-auth
git fetch origin
git rebase origin/main
git rebase -i origin/main
Conflict Resolution
Strategy
- Understand both sides of the conflict
- Determine which changes to keep (or merge both)
- Test after resolution
- Never blindly accept "ours" or "theirs"
git status
git mergetool
git add <resolved-files>
git rebase --continue
History Investigation
git log --grep="fix auth"
git blame <file> -L <start>,<end>
git bisect start
git bisect bad HEAD
git bisect good v1.0.0
git log -p -S "functionName" -- <file>
Recovery
git reset --soft HEAD~1
git reflog
git checkout -b <branch> <reflog-sha>
git revert <sha>
git restore --staged <file>
git restore <file>
Best Practices
- Commit often — small, atomic commits are easier to review and revert
- Pull before push — avoid unnecessary merge commits
- Don't rewrite shared history — never force-push to main/master
- Use
.gitignore — keep build artifacts, secrets, and IDE files out
- Write meaningful messages — future-you will thank present-you
- Review diffs before committing —
git diff --staged catches mistakes