Under Ubuntu and Debian the last committed files are getting the execution bit set, when I try a checkout afterwards. It's quite strange and driving me nuts:
$ ls -l file
-rw-r--r-- ... file
# on branch master:
$ git commit -m 'mode is 644' file
[master 0123456] mode is 644
1 files changed, 1 insertions(+), 1 deletions(-)
# All ok
$ git checkout dev-branch
Switched to branch 'dev-branch'
# Seemingly all ok, but file now has the exec bit set
$ git merge master
Updating 6543210..0123456
error: Your local changes to 'file' would be overwritten by merge. Aborting.
Please, commit your changes or stash them before you can merge.
# Oops...
$ ls -l file
-rwxr-xr-x ... file
Has anyone an idea, when and why the execution bit slips in? core.filemode is set to true.
I have the file open in vim during the branch switching, if that's important somehow.
Addendum 1: It's the checkout, where the permissions are screwed up. I can play the game on and on:
$ git br
* master
dev-branch
$ git diff
diff --git a/file b/file
old mode 100644
new mode 100755
$ chmod 644 file
$ git diff
$ git checkout dev-branch
$ git diff
diff --git a/file b/file
old mode 100644
new mode 100755
$ chmod 644 file
$ git diff
$ git checkout master
$ git diff
diff --git a/file b/file
old mode 100644
new mode 100755
# ...and so on ad inf.
Addendum 2: This happens, by the way, for every file in this repository, that I commit. After the successful commit I can't switch branches without the permission screw-up.
git-logshows no output at all, for neither combination ofmaster,dev-branchorHEAD(which is strange, isn't it? Shouldn't the command print the last commit message frommaster?)