git-expert
About
The git-expert skill provides developers with expert guidance on core Git operations and best practices. It assists with writing conventional commits, resolving merge conflicts, managing branches, and troubleshooting repository issues. Use this skill when you need help crafting commit messages, rebasing, cherry-picking, or implementing branching strategies.
Quick Install
Claude Code
Recommended/plugin add https://github.com/robconery/github-devgit clone https://github.com/robconery/github-dev.git ~/.claude/skills/git-expertCopy and paste this command in Claude Code to install this skill
Documentation
π Git Expert
Expert guidance for Git operations including commit crafting, conflict resolution, and branch management.
π Commit Messages
Format
<type>(<scope>): <subject>
<body>
<footer>
Types
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Formatting, no code changerefactor: Code restructuring without behavior changeperf: Performance improvementtest: Adding/updating testschore: Build process, dependencies, tooling
Rules
- Subject line: max 50 characters, imperative mood ("Add feature" not "Added feature")
- Body: wrap at 72 characters, explain what and why, not how
- Separate subject from body with blank line
- Reference issues in footer:
Fixes #123orCloses #456
Examples
Good:
feat(auth): add OAuth2 login support
Implement Google and GitHub OAuth providers to give users
alternative login methods beyond email/password.
- Add OAuth callback handlers
- Store provider tokens securely
- Link accounts to existing users by email
Closes #234
Bad:
fixed stuff and updated some things
βοΈ Merge Conflicts
Understanding Conflict Markers
<<<<<<< HEAD
Your current branch changes
=======
Incoming changes from merged branch
>>>>>>> feature-branch
Resolution Steps
git status- identify conflicted files- Open each file, locate
<<<<<<<markers - Decide what to keep: yours, theirs, or combination
- Remove all conflict markers
git add <resolved-files>git commit(orgit merge --continue/git rebase --continue)
Resolution Strategies
- Accept ours:
git checkout --ours <file> - Accept theirs:
git checkout --theirs <file> - Manual merge: Edit file to combine changes
- Use mergetool:
git mergetool
Abort if Needed
git merge --abort- cancel mergegit rebase --abort- cancel rebasegit cherry-pick --abort- cancel cherry-pick
π³ Branching
Naming Conventions
feature/short-description
bugfix/issue-number-description
hotfix/critical-fix-name
release/v1.2.0
Common Workflows
Feature Branch:
git checkout -b feature/new-feature main
# ... work ...
git checkout main
git merge feature/new-feature
git branch -d feature/new-feature
Rebase onto main:
git checkout feature/my-feature
git fetch origin
git rebase origin/main
# resolve conflicts if any
git push --force-with-lease
Interactive Rebase (squash commits):
git rebase -i HEAD~3 # last 3 commits
# Change 'pick' to 'squash' or 's' for commits to combine
Branch Commands
| Command | Purpose |
|---|---|
git branch | List local branches |
git branch -a | List all branches (including remote) |
git branch -d <name> | Delete merged branch |
git branch -D <name> | Force delete branch |
git branch -m <new> | Rename current branch |
git switch <branch> | Switch branches (modern) |
git switch -c <new> | Create and switch |
π§ Useful Commands
Inspection
git log --oneline --graph --all # visual history
git log -p <file> # file history with diffs
git blame <file> # line-by-line authorship
git show <commit> # commit details
git diff <branch1>..<branch2> # compare branches
Undo Operations
git reset --soft HEAD~1 # undo commit, keep staged
git reset --mixed HEAD~1 # undo commit, unstage (default)
git reset --hard HEAD~1 # undo commit, discard changes β οΈ
git revert <commit> # create inverse commit (safe)
git restore <file> # discard working changes
git restore --staged <file> # unstage file
Stashing
git stash # stash changes
git stash pop # apply and remove stash
git stash list # show stashes
git stash show -p # show stash diff
git stash drop # remove top stash
Cherry-picking
git cherry-pick <commit> # apply single commit
git cherry-pick <c1>..<c2> # apply range (exclusive)
git cherry-pick <c1>^..<c2> # apply range (inclusive)
git cherry-pick --no-commit <c> # apply without committing
π¨ Recovery
Find Lost Commits
git reflog # show all HEAD movements
git checkout <hash> # recover to specific point
git branch recover <hash> # create branch at lost commit
Fix Last Commit
git commit --amend # edit message or add files
git commit --amend --no-edit # add staged files silently
Clean Untracked Files
git clean -n # dry run - show what would be deleted
git clean -f # delete untracked files
git clean -fd # delete untracked files and directories
GitHub Repository
Related Skills
subagent-driven-development
DevelopmentThis skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.
algorithmic-art
MetaThis Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.
executing-plans
DesignUse the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.
cost-optimization
OtherThis Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.
