Tentar:
git config core.fileMode false
No git-config (1) :
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).
O -csinalizador pode ser usado para definir esta opção para comandos únicos:
git -c core.fileMode=false diff
E o --globalsinalizador fará com que seja o comportamento padrão para o usuário conectado.
git config --global core.fileMode false
Alterações na configuração global não serão aplicadas aos repositórios existentes. Além disso, git clonee git initexplicitamente definido core.fileModecomo truena configuração do repositório, conforme discutido no Git global core.fileMode false substituído localmente no clone
Atenção
core.fileModenão é a melhor prática e deve ser usada com cuidado. Essa configuração abrange apenas o bit de modo executável e nunca os bits de leitura / gravação. Em muitos casos, você acha que precisa dessa configuração porque fez algo como chmod -R 777tornar todos os seus arquivos executáveis. Mas na maioria dos projetos, a maioria dos arquivos não precisa e não deve ser executável por motivos de segurança .
A maneira correta de resolver esse tipo de situação é manipular a permissão de pasta e arquivo separadamente, com algo como:
find . -type d -exec chmod a+rwx {} \; # Make folders traversable and read/write
find . -type f -exec chmod a+rw {} \; # Make files read/write
Se você fizer isso, nunca precisará usar core.fileMode, exceto em ambientes muito raros.