File permission issues when developing with Windows / hosting with Unix

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.

  • git pulled files give 500 error
  • Git repo default ignore files permissions
  • git ssh ask for a password with gitlab
  • git deploying project - file permissions - (chmod)
  • git ignore permission for everyone
  • Git unable to update clean working directory
  • 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.

  • GIT: /.git/index.lock': File exists
  • Can't check out specific branches
  • Is it possible to make p4merge quit automatically when window is exited on mac os x?
  • Git, Behind Proxy and Keep Getting HTTP code = 417
  • How do I merge 2 branches in GIT into one branch with 2 folders
  • Hudson/Jenkins Git build all branches
  • One Solution collect form web for “File permission issues when developing with Windows / hosting with Unix”

    See: Updating file permissions only in git

    In summary, git update-index --chmod should do what you need.

    Git Baby is a git and github fan, let's start git clone.