When git pulls the code, it will display mode change, but the actual file content has not changed. How to solve this situation

1. Problem description

There are two main scenarios where I encounter this kind of problem:
one is after git pulls down the code and encounters this situation when I commit again;
the other is after I copy .git/the folder from one computer to another computer, This happens when I commit again.

The contents of the terminal prompt:

mode change 100644 => 100755 *********

Two, the solution

The main reason for this kind of prompt is the change of file permissions.
Description of Linux file read and write permissions (every three digits are a group, such as rw-corresponding 6, r--corresponding 4):

644 => 755
rw-r--r-- => rwxr-xr-x

The impact of this situation is not great. If you want to turn it off, you can use the following command:

git config core.filemode false

reference link

[1] joy Yu. When git pulls the code, it will display mode change, but the actual file has not changed. What is the situation [EB/OL]. https://segmentfault.com/q/1010000020369044, 2019-09-12 /2023-01-26.

Guess you like

Origin blog.csdn.net/qq_39779233/article/details/128768100