| name | git-workflow |
| description | Git workflow patterns — branching, committing, rebasing, conflict resolution. Use when working with git operations. |
| stage | raw |
Git Workflow
Branch Naming
feat/short-description — new feature
fix/short-description — bug fix
refactor/short-description — refactoring
chore/short-description — maintenance, config, deps
Commit Format
type: short description (imperative, English, max 72 chars, no period)
Types: feat, fix, refactor, chore, docs, test
Before Committing
git diff --staged — review all staged changes
- Run project tests (if they exist)
- Formatting is handled by hooks — do not run manually
Merge Conflicts
git fetch origin
git rebase origin/<target-branch>
- Resolve conflicts file by file
git add <resolved-files>
git rebase --continue
Undo Patterns
- Unstage file:
git reset HEAD <file>
- Discard working changes:
git checkout -- <file>
- Amend last commit (not pushed):
git commit --amend
- Undo last commit (keep changes):
git reset --soft HEAD~1
- Undo last commit (discard changes):
git reset --hard HEAD~1
PR Workflow
- Create branch from
dev (or project's default dev branch)
- Make changes, commit with descriptive messages
- Push:
git push -u origin <branch-name>
- Create PR via
gh pr create
- After approval: merge and delete branch