| name | git-workflow |
| description | Best practices for Git version control workflows including branching strategies, commit conventions, and collaboration patterns. Use when working with Git repositories, managing branches, or coordinating team development. |
| metadata | {"author":"mcp-tests","version":"1.0"} |
| allowed-tools | Bash(git:*) |
Git Workflow Skill
This skill provides guidance on effective Git workflows and best practices.
When to Use
- Starting work on a new feature or fix
- Managing branches and merges
- Writing commit messages
- Resolving merge conflicts
- Setting up repository workflows
Branch Naming Conventions
Use descriptive, prefixed branch names:
feature/add-user-authentication
bugfix/fix-login-redirect
hotfix/security-patch-cve-2024
refactor/extract-payment-module
docs/update-api-documentation
Commit Message Format
Follow conventional commits:
<type>(<scope>): <subject>
<body>
<footer>
Types
feat: New feature
fix: Bug fix
docs: Documentation only
style: Formatting, no code change
refactor: Code restructuring
test: Adding tests
chore: Maintenance tasks
Examples
feat(auth): add OAuth2 login support
Implement OAuth2 authentication flow with Google and GitHub providers.
Includes token refresh and secure storage.
Closes #123
fix(api): handle null response from payment gateway
The payment gateway occasionally returns null for declined cards.
Added null check and appropriate error message.
Fixes #456
Common Workflows
Feature Branch Workflow
git checkout main
git pull origin main
git checkout -b feature/my-feature
git add .
git commit -m "feat: implement feature"
git fetch origin
git rebase origin/main
git push -u origin feature/my-feature
Fixing a Bug
git checkout -b bugfix/issue-description
git add .
git commit -m "fix: resolve issue description"
git push -u origin bugfix/issue-description
Handling Merge Conflicts
git fetch origin
git rebase origin/main
git add <resolved-files>
git rebase --continue
git rebase --abort
Best Practices
Do
- Commit early and often
- Write meaningful commit messages
- Keep commits focused (one logical change)
- Pull/rebase before pushing
- Review your changes before committing
Don't
- Commit sensitive data (passwords, keys)
- Force push to shared branches
- Commit generated files
- Make huge commits with unrelated changes
- Leave work uncommitted for long periods
Useful Commands
git status
git diff
git add -p
git commit --amend
git log --oneline --graph
git stash
git stash pop
git reset --soft HEAD~1