Interview Prep/Git & GitHub/Repository Health, Size and Performance

`git blame` attributes half the file to a single "Reformat with Prettier" commit, hiding who really wrote the code.

BeginnerTroubleshootingRepository Health, Size and Performance
Answer

Likely causes → A bulk formatting commit touched every line, so it becomes the last change for all of them.

Diagnose → git log --oneline --format='%h %s' -- src/app.ts | grep -i format

Fix → Tell blame to skip it:

echo "a1b2c3d4e5f6...  # Prettier reformat" >> .git-blame-ignore-revs
git config blame.ignoreRevsFile .git-blame-ignore-revs
git blame src/app.ts

GitHub's blame view honours .git-blame-ignore-revs at the repo root automatically.

Prevent → Do formatting changes in isolated commits and record their SHAs in .git-blame-ignore-revs immediately after merging.

All Git & GitHub questions Roadmap: Git & GitHub

More on Repository Health, Size and Performance