[Abstract] But sometimes I find a problem. When I want to compare the code copied from other places with my own version, I find that all the codes are different. In fact, others only modify a few of them; Excluding the part of the code that you modified, the rest has not changed at all, so why does git prompt for changes?
Git must be very familiar to many development partners, and it is also a very efficient tool for version management. Especially when comparing the differences between the current version and the historical version, the git diff command can intuitively see what has been modified. I am used to lazy people's usage, and I directly use the git tool of the vscode tool to shortcut.
But sometimes I find a problem. When I want to compare the code copied from other places with my own version, I find that all the codes are different. In fact, others only modify a few of them; Excluding the part of the code that you modified, the rest has not changed at all, so why does git prompt for changes?
This is due to the change of filemode. Some bits of the chmod file have changed. If you strictly compare the original file and the chmod file, there is a difference between the two. But the source code usually only cares about the text content, so the changes caused by chmod should be ignored. So, set the following:
Switch to the root directory of the source code,
git config --add core.filemode false
Check again at this time. There is no abnormal reminder. Go to work happily
This article was last updated on April 11, 2023, and has not been updated for more than one year. If the article content or picture resources are invalid, please leave a message for feedback, and we will deal with it in a timely manner. Thank you!