Odd `git mv` behaviour
问题 Last month I started to contribute to a GitHub repository by forking the corresponding repo, creating a feature branch and then submitting a pull request. While repeating that process for a couple of days, I ran into a weird problem when renaming files with the pre-installed Linux command mv and also with the Git command git mv . The actual problem is, that depending on when you move/rename a file with git mv , when you git add it and at what point you edit the renamed file, you either get: