Comment faire Git ignorer les changements de mode de fichier (chmod)

Mots clés : gitignorechmodgit

meilleur 4 Réponses Comment faire Git ignorer les changements de mode de fichier (chmod)

vote vote

99

git config core.fileMode false 
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). 
git -c core.fileMode=false diff 
git config --global core.fileMode false 
find . -type d -exec chmod a+rwx {} \; # Make folders traversable and read/write find . -type f -exec chmod a+rw {} \;  # Make files read/write 
vote vote

80

git diff --summary | grep --color 'mode change 100755 => 100644' | cut -d' ' -f7- | xargs -d'\n' chmod +x git diff --summary | grep --color 'mode change 100644 => 100755' | cut -d' ' -f7- | xargs -d'\n' chmod -x 
git diff --summary | grep  'mode change 100755 => 100644' | cut -d' ' -f7- | xargs -e'\n' chmod +x git diff --summary | grep  'mode change 100644 => 100755' | cut -d' ' -f7- | xargs -e'\n' chmod -x 
vote vote

74

git config --global core.filemode false 
git config --add --global core.filemode false 
error: could not lock config file .git/config: No such file or directory 
vote vote

67

git config --global core.filemode false 
cd into yourLovelyProject folder 
cd .git 
nano config 
[core]         repositoryformatversion = 0         filemode = true 
[core]         repositoryformatversion = 0         filemode = false 
cd .. 
git init 

Questions similaires