Created
May 25, 2026 20:21
-
-
Save copyleftdev/1c3b1ee5cb0dde55ee2999b3399543ef to your computer and use it in GitHub Desktop.
git blame -C — follow code that moved between files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # git blame -C — follow moved code across files | |
| # Standard blame breaks when code moves. -C detects copies. | |
| # Without copy detection — everything attributed to the refactor commit: | |
| git blame src/freq.py | |
| # With copy detection — attribution follows the original author: | |
| git blame -C -C -C src/freq.py | |
| # Three -C flags: | |
| # -C detect copies within the same commit | |
| # -C -C also detect copies from any commit that touched the file | |
| # -C -C -C detect copies from any commit, across any file | |
| # Functions that moved during a refactor now show the commit | |
| # that *created* the logic, not the commit that moved it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment