Git diff is present on symbolic links on Windows but not on Mac on FAT file system

745 views Asked by At

I have a FAT external disk on which I store my GIT repos and use that reops both on Mac and on Windows. As FAT has no permissions, when I have copied files from local disk to external FAT disk I had git diffs because of the file mode changes. I have solved that with git option using this:

git config core.fileMode false

Now on Mac I don't have git diff, i.e. git diff is clean. But when I go on Windows and do git diff I see this:

enter image description here

I remember I had probles when linking my projects using Xcode 6 after updating the Xcode. My frameworks, the same frameworks that you see in the image above, where in Xcode but were not recognized and linked. So I have removed them an re-added and solved the problem. I guess this is the reason why I have diff. Here is an example of a diff:

Was: enter image description here

Become: enter image description here

Why I don't see this diff on Mac? Why I have diffs in iOS framework files and what the diff means (XSym, number [0022], hashcode)?

EDIT: Seems it is somehow connected with symbolic links on FAT: http://www.tucuxi.org/os-x-vfat/ but I am not certain how to solve my problem of using the same repo on Windows and Mac simultaneously.

1

There are 1 answers

0
Narek On BEST ANSWER

Here is explanation of the problem: http://www.tucuxi.org/os-x-vfat/ In two words FAT has no understanding of Symbolic Links and hence when you copy symbolic link onto FAT is tries to mimic with add the content mention is the diff in above images.

Here is the solution: https://www.kernel.org/pub/software/scm/git/docs/git-config.html In tow words, git core.symlinks config should be set false, so that symbolic links are checked out as small plain files that contain the link text:

git config core.symlinks false

And as a result the diff on Mac will be present too. And BTW the diff in the frameworks files what making them not to work on Xcode.

So in general using GIT on FAT I would recommend to set this global settings for GIT:

git config --global core.fileMode false
git config --global core.symlink false
git config --global core.ignorecase true

Check if it is properly set using:

git config -l

It shows all inherited values from: system, global and local.

Important! Even if you use git config --global core.symlink false, you should still checkout different repo for you OSX and Windows so that the option will take effect. So, basically, you should have 2 repo on your External HDD - one for OSX and one for Windows. Otherwise you still get diffs.