The code in the Git workspace is all changed into a modification state processing method

A problem occurred: the local code was uploaded to the remote git warehouse, the remote warehouse code was pulled on the linux service, and the modified content was submitted. When using git status to view the modified files, it was found that all files were in a modified state, including unmodified files.

Approach:

// Execute in the project directory

git config core.filemode false
 
//globally set
git config --global core.filemode false

Or directly modify
the filemode (in the [core] section) field of the config file in the .git directory of the code warehouse and change it to false.

Reason: Different operating systems use different line breaks. Unix/Linux uses LF, and windows uses CRLF. Git will automatically convert line breaks, but sometimes there is a problem with the conversion, and this problem will occur.

Guess you like

Origin blog.csdn.net/qq_36611673/article/details/127220425