Our review
This skill provides expert guidance for Git version control operations including commits, branches, merging, rebasing, and conflict resolution.
Strengths
- Covers all common Git operations from basic to advanced
- Clear explanations with concrete commands
- Includes typical workflows (feature branch, hotfix)
Limitations
- Does not replace deep understanding of Git internals
- May be limited for highly complex or repository-specific scenarios
Use this skill for precise advice on Git commands, workflows, or resolving version control issues.
Avoid using it when you need deep integration with specific Git APIs or advanced automation not covered here.
Security analysis
SafeThe skill provides a static reference of git commands and workflows. It does not instruct execution of any commands, nor does it contain scripts, URLs, or data exfiltration mechanisms. While git operations can be destructive (e.g., force push, hard reset), the skill is purely educational and does not automate risky actions.
No concerns found
Examples
How do I undo the last commit but keep the changes?I'm in the middle of a merge with conflicts. Can you help me resolve them step by step?Show me the complete workflow for creating a feature branch, working on it, and merging it back into main.name: Git description: Expert guidance for Git version control operations including commits, branches, merging, rebasing, conflict resolution, and Git workflows. Use this when working with Git repositories, version control, or collaborative development.
Git
Expert assistance with Git version control and collaborative workflows.
Essential Commands
Repository Setup
git init- Initialize new repositorygit clone <url>- Clone remote repositorygit remote add origin <url>- Add remotegit remote -v- List remotes
Daily Workflow
git status- Check working tree statusgit add .- Stage all changesgit add -p- Interactive staginggit commit -m "message"- Commit with messagegit commit --amend- Amend last commitgit pull- Fetch and merge from remotegit push- Push commits to remote
Branch Management
git branch- List local branchesgit branch -a- List all branches (including remote)git branch <name>- Create new branchgit checkout <branch>- Switch to branchgit checkout -b <name>- Create and switch to new branchgit branch -d <name>- Delete branch (safe)git branch -D <name>- Force delete branchgit push origin --delete <branch>- Delete remote branch
Viewing History
git log- View commit historygit log --oneline --graph- Compact graphical historygit log --author="name"- Filter by authorgit show <commit>- Show commit detailsgit diff- Show unstaged changesgit diff --staged- Show staged changesgit diff <branch1>..<branch2>- Compare branches
Undoing Changes
git restore <file>- Discard working changesgit restore --staged <file>- Unstage filegit reset HEAD~1- Undo last commit (keep changes)git reset --hard HEAD~1- Undo last commit (discard changes)git revert <commit>- Create new commit that undoes changesgit clean -fd- Remove untracked files
Stashing
git stash- Stash current changesgit stash list- List stashesgit stash pop- Apply and remove last stashgit stash apply- Apply last stash (keep in list)git stash drop- Delete last stash
Advanced Operations
Rebasing
# Rebase current branch onto main
git rebase main
# Interactive rebase (squash, reorder, edit commits)
git rebase -i HEAD~3
# Continue after resolving conflicts
git rebase --continue
# Abort rebase
git rebase --abort
Cherry-picking
# Apply specific commit to current branch
git cherry-pick <commit-hash>
# Cherry-pick without committing
git cherry-pick -n <commit-hash>
Merging
# Merge branch into current
git merge <branch>
# Merge without fast-forward (create merge commit)
git merge --no-ff <branch>
# Abort merge
git merge --abort
Conflict Resolution
# Show conflicts
git status
# After resolving conflicts in files
git add <resolved-file>
git commit
# Use theirs/ours for entire file
git checkout --theirs <file>
git checkout --ours <file>
Git Workflows
Feature Branch Workflow
# Create feature branch
git checkout -b feature/new-feature
# Work and commit
git add .
git commit -m "Add new feature"
# Update from main
git checkout main
git pull
git checkout feature/new-feature
git rebase main
# Push feature branch
git push -u origin feature/new-feature
Hotfix Workflow
# Create hotfix from main
git checkout main
git pull
git checkout -b hotfix/critical-fix
# Fix and commit
git commit -am "Fix critical bug"
# Merge back to main
git checkout main
git merge hotfix/critical-fix
git push
# Clean up
git branch -d hotfix/critical-fix
Configuration
User Setup
git config --global user.name "Your Name"
git config --global user.email "your@email.com"
Useful Aliases
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.lg "log --oneline --graph --all"
Editor
git config --global core.editor "vim"
Best Practices
- Commit Messages: Use clear, descriptive messages following conventional commits
- Small Commits: Make atomic commits that do one thing
- Pull Before Push: Always pull latest changes before pushing
- Branch Naming: Use descriptive names like
feature/,bugfix/,hotfix/ - Never Force Push: Avoid
git push --forceon shared branches - Review Changes: Use
git diffbefore committing - Protect Main: Never commit directly to main/master
Troubleshooting
Undo accidental commit to wrong branch
git reset HEAD~1 # Undo commit, keep changes
git stash # Stash changes
git checkout <correct-branch>
git stash pop # Apply changes
git add .
git commit -m "message"
Fix merge conflicts
# View conflicts
git status
# Edit conflicting files (look for <<<<<<, ======, >>>>>>)
# Remove conflict markers and keep desired code
# Mark as resolved
git add <file>
git commit
Recover deleted branch
# Find commit hash
git reflog
# Recreate branch
git checkout -b <branch-name> <commit-hash>
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.