Interview Prep/Git & GitHub/GitHub features, history rewriting and scale

How does `git blame -C -C -C` detect code moved between files?

AdvancedConceptGitHub features, history rewriting and scale
Answer

-M detects lines moved within a file and -C detects lines copied from other files modified in the same commit. Repeating -C widens the search: twice looks in the file-creating commit, three times looks in any commit. It is how blame attributes extracted functions to the original author rather than to the refactor commit.

git blame -w -M -C -C -C src/service.py
All Git & GitHub questions Roadmap: Git & GitHub

More on GitHub features, history rewriting and scale