I have a repository with a folder named Hello
. It contains 5 files.
I renamed Hello
manually to World
without using git mv
.
I added a new folder Hello
and added/copied the same 5 files.
I commited, pushed, and created a PR. The PR shows that World
folder and the 5 files are new addition (all green). The Hello
folder and the 5 files are showing as diff changes (red blocks, green blocks). I expected this. That's why I use git mv oldname newname
always for rename.
I double checked in my local by pulling the PR branch. Lo and behold, the state is the opposite. Hello
folder and files appear to be new addition (my author name appears in every line using Git Lens). World
folder and files appear to be with diff changes (previous author names are appearing).
Why is this happening? Why is the PR diff vs git commits are different? Can someone explain or cite an article about this?