Issue
It appears Git is ignoring ~/.gitconfig
$ git config --global core.filemode false
$ git config -l
core.filemode=false
core.filemode=true
So now there are 2 entries for core.filemode
and git is still not ignoring filemode changes
$ touch modetest
$ git add .
$ git commit -m test1
[master (root-commit) 320cfe4] test1
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 modetest
$ chmod +x modetest
$ git diff
diff --git a/modetest b/modetest
old mode 100644
new mode 100755
Based on torek’s answer, I added this line to my .bash_profile
[ -d .git ] && git config core.filemode false
Solution
Maybe a bit overkill, but in Cygwin this bothered me enough to dig into the issue more. When git is built from source code, it checks the file system it's built on to see if it understands executable bits.
I went ahead and built git from source on my Cygwin system and installed it to a local directory, then added the binary to my path. The basic steps are:
cd ~/
mkdir git
cd git
mkdir inst
git clone -c core.autocrlf=false https://github.com/git/git.git
cd git
NO_TRUSTABLE_FILEMODE=1 make prefix=/home/[username]/git/inst/
NO_TRUSTABLE_FILEMODE=1 make prefix=/home/[username]/git/inst/ install
Then add something like this to .bashrc:
export PATH=/home/[username]/git/inst/bin:$PATH
Of course, that build won't work unless you have all the build dependencies installed in Cygwin. With a little poking around I was able to do it without too much trouble. Now git init and git clone on that system defaults filemode to false. The trick is defining NO_TRUSTABLE_FILEMODE for the build.
Answered By - ZeroG Answer Checked By - Marilyn (WPSolving Volunteer)