bashintermediate
Git Blame — Ignore Formatting Commits
Configure git blame to skip formatting-only commits using .git-blame-ignore-revs for cleaner history.
bashPress ⌘/Ctrl + Shift + C to copy
# Create .git-blame-ignore-revs in repo root
cat > .git-blame-ignore-revs << 'EOF'
# Prettier migration — bulk reformat
abc1234abc1234abc1234abc1234abc1234abc1234
# ESLint auto-fix pass
def5678def5678def5678def5678def5678def5678
# Rename files to kebab-case
ghi9012ghi9012ghi9012ghi9012ghi9012ghi9012
EOF
# Configure git to use this file automatically
git config blame.ignoreRevsFile .git-blame-ignore-revs
# Now git blame skips those commits:
git blame src/app.ts
# Shows the actual authorship, not the reformatter
# Blame with specific ignore file (one-off)
git blame --ignore-revs-file .git-blame-ignore-revs src/app.ts
# Blame showing email instead of name
git blame -e src/app.ts
# Blame specific line range
git blame -L 10,20 src/app.ts
# Blame with commit date
git blame --date=short src/app.ts
# Find when a line was deleted (reverse blame)
git log -S 'deletedFunction' --oneline -- src/app.tsUse Cases
- Ignoring bulk formatting commits in blame output
- Accurate code ownership tracking
- Onboarding — understanding who wrote what
Tags
Related Snippets
Similar patterns you can reuse in the same workflow.
bashbeginner
Git Log Formatting Tricks
Custom git log formats with graphs, filtering by author, date ranges, and file changes.
Best for: Reviewing project history efficiently
#git#log
bashbeginner
Git Aliases for Productivity
Essential git aliases and config settings to speed up daily git workflow and reduce typing.
Best for: Speeding up daily git workflow
#git#aliases
bashintermediate
Git Blame Investigation Techniques
Use git blame and related tools to trace code authorship and understand change history.
Best for: Finding who introduced a bug
#git#blame
bashbeginner
Git Config — Essential Global Settings
Configure Git globally with aliases, default branch, editor, credentials, and performance settings.
Best for: Setting up Git on a new machine
#git#config