| name | git-workflow-skill |
| description | Use when managing git branches, commits, pull requests, merge conflicts, or git workflows. Triggers: "git branch", "git merge", "conflict", "pull request", "commit", "rebase", "cherry-pick", "stash". |
Git Workflow Skill
Purpose
Standardize git usage, branch strategies, commit conventions, and collaborative workflows across
projects.
Branch Strategy
main (production)
develop (integration)
feature/user-authentication
feature/payment-integration
bugfix/login-error
release/v1.2.0
| Branch | Purpose | Protection |
|---|
main | Production code | Required PR + review |
develop | Integration branch | Required PR + review |
feature/* | New features | PR after completion |
bugfix/* | Bug fixes | PR after completion |
release/* | Release preparation | Direct commit allowed |
hotfix/* | Urgent production fixes | Direct commit allowed |
Enforcement Profile (Repository Runtime)
- Direct push to
main and develop is blocked by default.
- Branch names must follow GitFlow patterns:
feature/*, bugfix/*, chore/*, hotfix/*,
release/*.
- PR base mapping is enforced:
feature/*, bugfix/*, chore/* -> develop
hotfix/*, release/* -> main
- Override for protected direct push is allowed only with explicit environment variable
GITFLOW_ALLOW_PROTECTED_PUSH=1.
Commit Convention (Conventional Commits)
<type>(<scope>): <description>
[optional body]
[optional footer]
Types
| Type | Description |
|---|
feat | New feature |
fix | Bug fix |
docs | Documentation only |
style | Formatting, no code change |
refactor | Code change, no feature/fix |
test | Adding tests |
chore | Maintenance, deps update |
perf | Performance improvement |
ci | CI/CD changes |
build | Build system changes |
revert | Revert previous commit |
Examples
feat(auth): add OAuth2 login with Google
Closes
Breaks:
fix(api): handle null response from payment provider
The payment provider sometimes returns null instead of
an error object. Added null check to prevent crash.
Branch Naming
feature/add-user-profile-page
feature/US-123-user-profile
bugfix/fix-login-timeout
bugfix/gh-456-login-error
hotfix/security-patch-cve-2024
release/v1.2.0
chore/update-dependencies
Daily Workflow
git checkout develop
git pull --rebase
git checkout -b feature/my-feature
git add .
git commit -m "feat(scope): description"
git fetch origin
git rebase origin/develop
git push -u origin feature/my-feature
Handling Merge Conflicts
git rebase origin/develop
git add file1.js file2.js
git rebase --continue
git push --force-with-lease
git checkout feature/my-feature
git merge develop
git add .
git commit
git push
Pull Request Checklist
PR Template
## Summary
Brief description of changes.
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
How was this tested?
## Screenshots (if applicable)
## Checklist
- [ ] My code follows the style guidelines
- [ ] I have performed self-review
- [ ] I have commented complex code
- [ ] I have updated documentation
Useful Aliases
[alias]
st = status
co = checkout
br = branch
ci = commit
unstage = reset HEAD --
last = log -1 HEAD
visual = log --graph --oneline --decorate --all
amend = commit --amend --no-edit
undo = reset --soft HEAD~1
clean-branches = !git branch --merged | grep -v '\\*\\|main\\|develop' | xargs -r git branch -d
Common Commands Reference
git fetch --all
git pull --rebase
git checkout -b feature/name
git push -u origin feature/name
git add -p
git commit --amend
git rebase -i HEAD~3
git merge --no-ff feature/name
git merge --squash feature/name
git tag v1.0.0
git tag -a v1.0.0 -m "versión 1.0.0"
git push origin v1.0.0
git stash
git stash pop
git stash list
git stash drop
git log --oneline --graph --all
git blame file.js
git show commit-id
Source: EmmanuelOrtiz87/gentle-vanguard — distributed by TomeVault.