Visual Studio runs a story between two commits to determine if a file has been renamed. Here I renamed one file from its original name to renamed and made changes to the contents at the same time:

However, Git does not track changes between the two commits - instead, it compares the snapshots of the commits to determine how the files were changed. Thus, there is no information about renaming in the repository history. Instead, this is calculated by comparing the file in the original commit with the file in the subsequent commit. If they are similar enough, then Git will consider it a renaming.
Since this is a heuristic, this does not guarantee that this will be considered a renaming. However, Visual Studio and Git for Windows need to harmonize these things, generally speaking. I would be curious why you are reporting this as a rename, and the other is not. Two possibilities are possible:
- This file is very close to the edge of similarity - let's say Git decided that the two revisions are 61% similar to each other and thus are renamed, while Visual Studio decided that these two versions are only 59% similar, and therefore, are not a renaming.
- There is some kind of error when Visual Studio incorrectly calculates the similarity. If I were to guess, I would suggest that the problem with a space or line ends, because it is always a problem in Git.
If you can share two versions of this file, opening a connection error or sending an email will directly help me to continue the research.
Edward thomson
source share