| name | git |
| description | Git operations, conflict resolution, history management, and Git workflows. Use for complex Git operations and version control tasks. |
| allowed-tools | Bash |
Git Skill
Advanced Git operations and workflows.
1. Branch Management
git checkout -b feature/new-feature
git branch -m old-name new-name
git branch -d feature-branch
git branch -D feature-branch
git branch -a
git branch -r
2. Commit Management
git commit --amend -m "New message"
git rebase -i HEAD~3
git cherry-pick <commit-hash>
git revert <commit-hash>
git reset --soft HEAD~1
git reset --mixed HEAD~1
git reset --hard HEAD~1
3. Conflict Resolution
git status
git add <resolved-file>
git commit
git merge --abort
git checkout --ours <file>
git checkout --theirs <file>
4. Stash Operations
git stash save "work in progress"
git stash list
git stash apply stash@{0}
git stash pop
git stash drop stash@{0}
git stash branch new-branch
5. History and Search
git log --oneline --graph --all
git log --author="name"
git log --since="2 weeks ago"
git log --grep="bug fix"
git log -S "function_name"
git show <commit-hash>
git diff HEAD~1 HEAD
git bisect start
git bisect bad
git bisect good <commit-hash>
git bisect reset
6. Remote Operations
git remote add origin https://github.com/user/repo.git
git fetch origin
git pull origin main
git push origin feature-branch
git push -u origin feature-branch
git push origin --delete feature-branch
7. Workflows
Feature Branch Workflow:
git checkout -b feature/new-feature
git add .
git commit -m "Add new feature"
git push -u origin feature/new-feature
Git Flow:
git checkout -b feature/name develop
git checkout develop
git merge --no-ff feature/name
git branch -d feature/name
git checkout -b release/1.0.0 develop
git checkout main
git merge --no-ff release/1.0.0
git tag -a 1.0.0
git checkout develop
git merge --no-ff release/1.0.0
8. Useful Aliases
[alias]
st = status
co = checkout
br = branch
ci = commit
unstage = reset HEAD --
last = log -1 HEAD
lg = log --oneline --graph --all --decorate
9. Cleanup
git clean -fd
git remote prune origin
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
When to Use This Skill
Use /git for complex Git operations, conflict resolution, and version control workflows.