6

In a git repository I changed file permissions. If I run the command

git status

or

git status -v

I do not see any changes. It only shows

On branch xxxxx
nothing to commit, working directory clean

But I did change permissions on files and folders from 644 to 777. How can I tell git to show me permission changes?

( git version 2.2.1 and filemode = true)
caramba
  • 21,963
  • 19
  • 86
  • 127
  • 4
    Git _only_ tracks the executable bit of files. It doesn't care/track other file permissions (and doesn't track folders at all). – AD7six Aug 10 '15 at 15:05
  • @Kamiccolo thank you, I do not want to recover anything I want to see changes happend – caramba Aug 10 '15 at 15:09
  • @AD7six thank you for the comment. I don't get it, can you please explain a little further what that means. I changed files from 644 to 777 – caramba Aug 10 '15 at 15:11

2 Answers2

3

You can enable filemode and Git will also track file permission changes.

git config core.filemode true
tombeynon
  • 2,216
  • 1
  • 20
  • 19
  • 1
    that does not help, I will update the question with those informations I forgot – caramba Aug 10 '15 at 15:02
  • 2
    I see, in that case this answer should cover what you need http://stackoverflow.com/questions/3207728/retaining-file-permissions-with-git – tombeynon Aug 10 '15 at 15:46
  • That link does help, thank you @tombeynon! (damm my question is a duplicate) – caramba Aug 11 '15 at 05:48
0

Some filesystems lose the executable bit when a file that is marked as executable is checked out, or checks out an non-executable file with executable bit on. git-clone[1] or git-init[1] probe the filesystem to see if it handles the executable bit correctly and this variable is automatically set as necessary.

A repository, however, may be on a filesystem that handles the filemode correctly, and this variable is set to true when created, but later may be made accessible from another environment that loses the filemode (e.g. exporting ext4 via CIFS mount, visiting a Cygwin created repository with Git for Windows or Eclipse). In such a case it may be necessary to set this variable to false. See git-update-index[1].

The default is true (when core.filemode is not specified in the config file).

git update-index --chmod=+x

This might solve your problem. This Modifies the index or directory cache and Set the execute permissions on the updated files.

Abhijeet Kamble
  • 3,131
  • 2
  • 30
  • 36