Sambit
Sambit

Reputation: 464

Git shows all files as modified after changing file permission

I changed the file permission to 777 of a non-bare git repository on Ubuntu OS. After that all files in the repository is showing as modified. I don't want to add all files again and commit. I want to commit the files that I have edited. Is there any way to fix this?

Upvotes: 8

Views: 6176

Answers (2)

0xAX
0xAX

Reputation: 21837

If you want to ignore file permissions changes you can add:

git config core.fileMode false

to your ~/.gitconfig. See http://git-scm.com/docs/git-config

core.fileMode

If false, the executable bit differences between the index and the working tree 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.

Upvotes: 4

Jin
Jin

Reputation: 13553

git config core.fileMode false

This tells git to ignore exec-bit changes.

Upvotes: 41

Related Questions