There are two machines, A and B. And there are two branches, p16 and c2.
A has an ext3 filesystem, but on B, the archive lives on a TrueCrypt drive with VFAT, mount shows rw,uid=1000,gid=1000,umask=077
A has linked the directory tree of B into its directory tree using sshfs and then A pushed into B's p16 using the filesystem.
Now there are some permission problems:
B$ git status
# On branch p16
nothing to commit (working directory clean)
B$ git checkout c2
Switched to branch 'c2'
B$ git checkout p16
error: You have local changes to 'help.txt'; cannot switch branches.
git diff
shows me a changed mode for all files now:
B$git diff
diff --git a/help.txtt b/help.txt
old mode 100644
new mode 100755
diff --git a/169.txt b/169.txt
old mode 100644
new mode 100755
...
(a list with all files having their mode changed follows)
...
I guess the problem is that the local filesystem is a VFAT TrueCrypt container and the filesystem does not allow the permissions that the other machine expects.
How can I better link the two machines with different filesystems?
Such problems using Git can occur, if the file permissions of the operating system are not functioning as they should in that location. For example, when foreign filesystems are mounted.
The solution was pointed out by meagar in his comment on the question above:
Just make sure you have (within the [core]
section) a line
filemode=false
in .git/config which will tell Git to ignore the executable bit for files it's tracking.
Another way of doing the same thing would be to go to the root directory of the Git repository in the terminal and type:
git config core.filemode false
Note that changing this setting is occasionally necessary, but otherwise it is better to keep the default behaviour. It's important in many cases for Git to track file permissions correctly, so your project can work as it should.