| name | git-and-diff-workflows |
| description | Safe git and GitHub CLI workflows — status, diff, log, branch, PR operations with inspect-before-commit patterns. |
Git and diff workflows
Purpose
Repository operations with bounded diffs and explicit confirmation for history rewrites.
When to Use
- Before/after edits (
status, diff)
- PR/issue work (
gh)
- Secret scanning (
gitleaks read-only)
Required Tools
git, gh; optional delta, gitleaks, git-filter-repo (human-only).
Install
Install blocks are shared — See install-blocks.md.
Windows PowerShell
Use winget blocks from the reference when provisioning a new machine.
WSL2 Ubuntu
Use apt/curl blocks from the reference; symlink fdfind → fd if needed.
macOS
Use Homebrew blocks from the reference.
Common Commands
git status --short
git diff --stat
git diff -- path/to/file
git log --oneline -n 20
gh pr view 123 --json title,state,url
gh issue list --limit 20
gitleaks detect --source . --no-git -v 2>/dev/null | head -50
Agent-Safe Patterns
Commands Requiring Confirmation
See commands-requiring-confirmation.md. — especially reset, clean, force-push, filter-repo.
Troubleshooting
- Detached HEAD: ask user before checkout.
gh auth: user runs gh auth login.
Windows Notes
WSL2 Notes
Verification Checklist