How to REALLY show logs of renamed files with git

I think that the general drive behind Linus’ point is that—and take this with a pinch of salt—hardcore Git users don’t ever care about the history of a “file”. You put content in a Git repository because the content as a whole has a meaningful history.

A file rename is a small special case of “content” moving between paths. You might have a function that moves between files which a Git user might track down with the “pickaxe” functionality (e.g., log -S).

Other “path” changes include combining and splitting files; Git doesn’t really care which file you consider renamed and which one you consider copied (or renamed and deleted). It just tracks the complete content of your tree.

Git encourages “whole tree” thinking whereas many version control systems are very file-centric. This is why Git refers to “paths” more often than it refers to “filenames”.

Leave a Comment