GitHub workflow automation — branching, committing, pushing, pull requests, issues, and code review. Use when asked to commit, push, create PRs/branches/issues, or manage git workflow.
git status, git branch, git log --oneline -5# Create feature branch from main
git checkout main && git pull origin main
git checkout -b <type>/<name>
# Types: feature/, bugfix/, docs/, refactor/, test/, chore/
mainfeature/add-jwt-testing, bugfix/fix-port-detection# Stage specific files (never git add -A blindly)
git add <file1> <file2>
# Commit with conventional format
git commit -m "type(scope): description"
feat, fix, docs, refactor, test, chore.env, credentials, or secrets# First push (set upstream)
git push -u origin <branch-name>
# Subsequent pushes
git push
main/master without explicit user approvalgit pull --rebase first# Create PR linking to issue
gh pr create --title "Short title < 70 chars" --body "$(cat <<'EOF'
## Summary
- What changed and why
## Test plan
- [ ] How to verify
Fixes #<issue-number>
EOF
)"
Fixes #N or Closes #Ngh issue create --title "type: description" --body "$(cat <<'EOF'
## Problem
What needs to change
## Proposed solution
How to fix it
## Acceptance criteria
- [ ] Criteria 1
EOF
)"
# Review a PR
gh pr view <number>
gh pr diff <number>
gh pr checks <number>
# Comment or approve
gh pr review <number> --approve
gh pr review <number> --comment --body "feedback"
.env files, or credentialsgit add -A without reviewing what's staged--no-verify) unless user explicitly askstype(scope): descriptiongit status before committing