Reputation: 813
I am developing a website on my windows laptop, and I use Git for the version control.
When I add my files to Git, they are added under the mode 644. The problem is, on my Linux server, I need the files to be 775. So what I do is, every time I deploy, I have to run chmod 775 -R .
on my linux server and then commit the mode changes.
This is really anoying, time consuming, and result in lot of stranges commits.
My question is, how can I make my IDE (PHPStorm) create the files direcly with mode 775? I know Windows does not use the same file permission system as UNIX, but there must be a way to set the files permissions on windows that translates to 775 in Linux?
I tried to use "chmod" command on windows using Cygwin or similar tools, with no luck, Git always saves the files as 644 when I commit on windows.
Upvotes: 4
Views: 776
Reputation: 1161
See: Updating file permissions only in git
In summary, git update-index --chmod
should do what you need.
Upvotes: 4