views:

579

answers:

3

I have a git checkout. All the file permissions are different than what git thinks they should be therefore they all show up as modified.

Without touching the content of the files (just want to modify the permissions) how do I set all the files permissions to what git thinks they should be?

+3  A: 

Git doesn't store file permissions other than executable scripts. Consider using something like git-cache-meta to save file ownership and permissions.

kroger
A: 

The easiest thing to do is to just change the permissions back. As @kroger noted git only tracks executable bits. So you probably just need to run chmod -x filename to fix it (or +x if that's what's needed.

Pat Notz
+4  A: 

Try git config core.filemode false

From the git config man page:

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

The default is true, except git-clone(1) or git-init(1) will probe and set core.fileMode false if appropriate when the repository is created.

Tim Henigan
Thanks, this is what I ended up doing. Very used to cvs not tracking permissions so this works.
Darvan Shovas
@shovas: I am glad this helped. I experienced a similar issue when sharing repos between Linux and Windows. BTW: if this answered your question, please mark the response as correct.
Tim Henigan