Has behavior for `git mv` changed? Last time I investigated, the command was convenience to `git add` after a `mv` with a single command. Git doesn't actually explicitly track renames, it leverages some sort of auto-detection based on file content similarity.
Still good to use the command, just keep in mind git isn't really treating it any different than a normal `mv` followed by `git add`.
https://git.wiki.kernel.org/index.php/GitFaq#Why_does_Git_no...
Re:Happiness is a freshly organized codebase
by nlawalker on Friday May 08, 2020 @12:56AM
(#23111536)
This might not be the forum for it, but I have a question about this - I thought git was supposed to be pretty smart about detecting renames, but in my experience (on Windows) it never does, and I always have to use `git mv`. What's the deal with this?
Re:Happiness is a freshly organized codebase
by ThePadawan on Friday May 08, 2020 @05:14AM
(#23112848)
Even if rename detection is enabled, git will only try to identify renames if it wouldn't take too much time (since IIRC it's a O(#files^2) operation).
Thus, there's a config "diff.renameLimit" and "merge.renameLimit" that tells git to only detect renames if less than N files are affected.
I have personally been burned by this before, and there usually is a default value set in most git clients.
See also some discussion at https://stackoverflow.com/a/7831027/1237375 .
That aside, there are some many productivity and tooling gains around organizing your project properly, that it is worth history discontinuities.
Also, I've found that the worse the project organization is, the less likely the team is to separate out different fileset changes into different commits to keep a useful history, or make the use of the git history at all outside of looking at a few recent commits or or sometimes looking at the last release. I've heard this as very circular arguments. Can't re-org because we loose history. Can't maintain good history because the project is too disorganized.