Git Workflow
Commit Messages
<type>(<scope>): <subject>
[optional body]
[optional footer]
Types: feat, fix, docs, style, refactor, test, chore
Good: feat(auth): add OAuth2 support for GitHub login
Bad: fixed stuff
Branch Naming
<type>/<ticket>-<description>
Examples:
feature/PROJ-123-user-authenticationfix/PROJ-456-null-pointer-crashhotfix/PROJ-789-security-patch
Common Operations
# Interactive rebase to clean up commits
git rebase -i HEAD~3
# Squash last N commits
git reset --soft HEAD~N && git commit
# Cherry-pick specific commit
git cherry-pick <sha>
# Undo last commit (keep changes)
git reset --soft HEAD~1
# Find commit that introduced bug
git bisect start
git bisect bad HEAD
git bisect good <known-good-sha>
Merge Conflict Resolution
git status— identify conflicted files- Open file, look for
<<<<<<<,=======,>>>>>>> - Keep correct code, remove markers
git add <file>thengit rebase --continueorgit merge --continue
Pre-commit Checks
Always run before pushing:
- Linting/formatting
- Unit tests
- Type checking (if applicable)
Source: aws-samples/sample-kiro-cli-multiagent-development — distributed by TomeVault.