3

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

Sam Kong
  • 5,472
  • 8
  • 51
  • 87
  • Which filesystem is the repository on? What happens if you use `git diff` to show the modifications of the files? – David Z Sep 02 '10 at 21:20

4 Answers4

3

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
  • 47,058
  • 7
  • 102
  • 144
2

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".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

Another solution could be, if you are sure that there is no changes between the 2 folders, to checkout and pull

git checkout -- .
git pull
Plopix
  • 185
  • 1
  • 10
1

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.

brycemcd
  • 4,343
  • 3
  • 26
  • 29