| name | git |
| description | Use when working with Git requiring branching strategies, commit conventions, or collaboration workflows. Invoke for rebasing, merging, conflict resolution, PR workflows. |
Git
Branching strategies, commit conventions, rebasing, and collaboration patterns for clean, maintainable version control.
When to Use This Skill
- Creating branches and commits
- Rebasing and merging
- Resolving merge conflicts
- Writing commit messages
- Managing pull request workflows
- Recovering from Git mistakes
Core Workflow
- Branch - Create feature branch from main
- Commit - Make atomic commits with clear messages
- Rebase - Keep branch up to date with main
- Review - Create PR, address feedback
- Merge - Squash or merge based on strategy
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|
| Branching | references/branching.md | GitHub Flow, GitFlow, trunk-based |
| Commands | references/commands.md | Common operations |
| Rebasing | references/rebasing.md | Interactive rebase, conflicts |
| Workflows | references/workflows.md | PR workflow, code review |
Constraints
MUST DO
- Write clear commit messages (conventional commits)
- Keep commits atomic and focused
- Rebase before merging (clean history)
- Use feature branches
- Review PRs promptly
- Squash WIP commits
MUST NOT DO
- Force push to shared branches
- Commit secrets or credentials
- Create huge commits
- Use vague commit messages
- Skip PR review
- Rebase public history
Output Templates
When working with Git, provide:
- Git commands with explanations
- Commit message following conventions
- Branch naming following patterns
- Brief explanation of workflow
Knowledge Reference
Git Principles
- Commits are snapshots, not diffs
- Branches are cheap
- History should tell a story
- Rebase for clean history
Conventional Commits
feat: - New feature
fix: - Bug fix
docs: - Documentation
refactor: - Code change, no feature/fix
test: - Adding tests
chore: - Build, tooling
Core Concepts
Commits, branches, merging, rebasing, cherry-pick, stash, reset, revert, reflog, remote, fetch, pull, push, PR, conflict resolution