22

I have some git projects in a linux server.

i use Mac and linux to do my programming. the problem is that the mac filesystem's permissions doesn't really work well like in linux so all the files seems to be on umask 0755. so whenever i pull my code on my mac, git status shows that all my files are changed and when i use git diff it shows that the only change is in the umask. how can i tell git not to store and check for umask changes ?

thanks!

ufk
  • 919

2 Answers2

32

Set the core.fileMode configuration property to false. You can do this easily with this command:

git config core.fileMode false
Patches
  • 16,572
1

I have a small shell script to toggle this

cat ~/bin/git-ignore-chmod-toggle

#!/bin/bash
# Copyright 2015 Alexx Roche, MIT license.
# based on http://superuser.com/a/261076

gitCHMODstate=$(git config --get core.fileMode)

# toggle with git config core.fileMode true 

if [ $gitCHMODstate == 'true' ];then
    echo "git now ignores file mode (chmod)"
    git config core.fileMode false
else
    echo "git not looks for files modes changed with chmod"
    git config core.fileMode true
fi

With this I can toggle git, check for other changes and then put back on quickly.