1

We are using Git and GitHub

We have both Windows and Linux developers in our team.

The application will finally run on a Linux distribution.

Some of the files must have execute permission set (let's say chmod 777 for the sake of simplicity)

Is there any way for the Windows git clients to set the Linux file permissions in a git repository?

Conclusion

Use git update-index --chmod=+x <file> to set the permissions as @lavanya answered.

Use git ls-files -s to see the permissions. see this post explains how read the 6 digit mode number :How to read the mode field of git-ls-tree's output

Allan Xu
  • 7,998
  • 11
  • 51
  • 122

1 Answers1

2

yes you can do it .

For example following command adds user execute permission to an arbitrary file:

git update-index --chmod=+x <file>

check this link Git file permissions on Windows

lavanya
  • 106
  • 3