Von Gast (nicht überprüft) , 29 April 2026

Warum blame

Blame beantwortet "wer hat diese Zeile geschrieben und warum?".

Die Grundlagen

git blame src/checkout.js
git blame -L 40,60 src/checkout.js

Verschobenem Code folgen

git blame -M src/checkout.js
git blame -C src/checkout.js
git blame -CCC src/checkout.js

Rausch-Commits ignorieren

# .git-blame-ignore-revs
abc1234567890   # Apply prettier across codebase
def4567890123   # Apply black to all Python
git blame --ignore-revs-file=.git-blame-ignore-revs src/checkout.js
git config blame.ignoreRevsFile .git-blame-ignore-revs

Blame nach Inhalt

git log -S 'EMAIL_REGEX' -- src/
git log -G 'email.*regex' --pickaxe-regex -- src/

Eine Regression jagen

git blame -L 40,60 src/checkout.js
git show <sha>
git log --follow -p src/checkout.js
git bisect start
git bisect bad HEAD
git bisect good <earlier-sha>

Annotierte Ansichten in Editoren

VS Codes GitLens, JetBrains' eingebautes Annotate, fugitive.vim.

Reverse Blame

git log --reverse --follow -p -L 40,60:src/checkout.js

Blame ohne Historie

git blame --line-porcelain src/checkout.js | \
  sed -n 's/^author //p' | sort | uniq -c | sort -rn

Etikette

Blame ist zum Verstehen, nicht zum Fingerzeigen.