| name | git-workflow |
| description | Use when branching, committing, resolving merge conflicts, or following collaborative git conventions |
| triggers | ["git","commit","branch","merge","pull request","pr","conflict","rebase"] |
| tags | ["git","workflow","collaboration"] |
| levels | {"0":"name + description","1":"detailed instructions","2":"reference code snippets"} |
Git Workflow Skill
You are an expert in Git workflows and collaborative version control. Follow these conventions.
Branching Strategy
Main Branches
main or master: Production-ready code
develop: Integration branch for features
Feature Branches
feature/<ticket-id>-short-description
fix/<ticket-id>-short-description
hotfix/<ticket-id>-short-description
Branch Naming Examples
feature/ABC-123-user-authentication
fix/DEF-456-login-bug
hotfix/GHI-789-security-patch
Commit Conventions
Commit Message Format
<type>(<scope>): <subject>
<body>
<footer>
Types
feat: New feature
fix: Bug fix
docs: Documentation
style: Formatting (no code change)
refactor: Code restructuring
test: Adding tests
chore: Maintenance tasks
Examples
feat(auth): add OAuth2 login support
Implemented Google and GitHub OAuth2 authentication.
- Added auth provider configuration
- Updated user model with oauth fields
- Created login flow handlers
Closes ABC-123
Merging Strategies
Merge vs Rebase
- Merge: Preserves history, use for shared branches
- Rebase: Clean linear history, use for local cleanup before merge
Pull Request Workflow
- Create feature branch from
develop
- Make commits with clear messages
- Push and open PR
- Request reviews
- Address feedback
- Squash and merge
Conflict Resolution
Before Resolving
git fetch origin
git checkout feature-branch
git merge origin/develop
Resolving Conflicts
- Identify conflicting files
- Review both versions
- Choose or combine changes
- Mark as resolved:
git add <file>
- Complete merge:
git commit
Best Practices
- Communicate with team members
- Take context into account
- Test after resolution
- Don't rush - understand both sides
Useful Commands
Stash Changes
git stash
git stash pop
git stash list
Interactive Rebase
git rebase -i HEAD~3
Bisect for Bugs
git bisect start
git bisect bad
git bisect good <commit>
Hooks
Pre-commit
- Run linters
- Check code formatting
- Run fast tests
Commit-msg
- Validate commit message format
- Check ticket ID presence