github - PR diff and Git Lens commits are out of sync - Stack Overflow

admin2025-04-17  2

  1. I have a repository with a folder named Hello. It contains 5 files.

  2. I renamed Hello manually to World without using git mv.

  3. I added a new folder Helloand added/copied the same 5 files.

  4. 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.

  5. 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?

转载请注明原文地址:http://anycun.com/QandA/1744878024a88899.html