[Fill the pit] Windows clone remote warehouse file permissions are modified

Problem Description:

Permission issues occur in the warehouse that git clone down

old mode 100755  
new mode 100644

problem causes

Some file systems will lose the executable bit when checkout marked executable files or checkout non-executable files with executable bits. 7 (111) The missing executable bit is 6 (110).

core.fileMode
Tells Git if the executable bit of files in the working tree is to be honored.

Some filesystems lose the executable bit when a file that is marked as executable is checked out, or checks out a non-executable file with executable bit on. git-clone[1] or git-init[1] probe the filesystem to see if it handles the executable bit correctly and this variable is automatically set as necessary.

A repository, however, may be on a filesystem that handles the filemode correctly, and this variable is set to true when created, but later may be made accessible from another environment that loses the filemode (e.g. exporting ext4 via CIFS mount, visiting a Cygwin created repository with Git for Windows or Eclipse). In such a case it may be necessary to set this variable to false. See git-update-index[1].

The default is true (when core.filemode is not specified in the config file).

solution:

Method 1. Use the following instructions to solve:

git config core.filemode false

Method 2. Add parameters when clone

git clone --config core.filemode=false YOUR_REPOSITORY

Method 3. Modify file permissions

git update-index --chmod=+x <file>

reference

  1. How do I remove files saying “old mode 100755 new mode 100644” from unstaged changes in Git?
  2. Git file permissions on Windows

Guess you like

Origin blog.csdn.net/qq_20515461/article/details/107769346