views:

37

answers:

3

Hi,

When I copy files from my Linux machine to my external HDD (FAT format), 'git status' shows that files are modified. I guess that occurs because of the file system difference.

I formatted the external HDD with FAT to share it with my Mac, Windows, and Linux.

How can I solve this problem?

Thanks.

Sam

+1  A: 

This could be caused by mismatched permission bits. From git-config manpage:

core.fileMode

If false, the executable bit differences between the index and the working copy are ignored; useful on broken filesystems like FAT. See git-update-index(1).

jpalecek
I tried it and it worked. Thanks.
Sam Kong
+2  A: 

Don't forget to set your core.autocrlf to false.
The eol (end of line) style can vary between OS/supports and introduce those "changes".

VonC
A: 

When you're copying files, if you're physically moving the bits from one disk to another (like with cp or drag and dropping), then you might consider creating a bare repo on your external drive to push/pull from on your other systems.

It doesn't address the EOL changes that need to be made ( mentioned in VonC's response for example), but it does save a little time copying files back and forth between drives.

Bryce