How can just set write permission (unix chmod 0777) to a folder and git commit it in windows?

I use git in windows.

I know for set executeable file and commit it, can use this:

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

But now, How can just set read and write permission (unix chmod 0777) to a folder and git commit it in windows?!

And also I try git config core.filemode true and chmod 077 <folder> in Cygwin but does not work.

Note that I am talking about folder and not file permissions.

  • Bash in Git for Windows: Weirdness when running a command with CMD.exe /C with args
  • Invalid id: Process leaked file descriptors. Jenkins
  • Run Git GUI and Tortoise GUI in parallel
  • How to download google source code for android
  • Can't get SSH public key authentication
  • Git Extensions usable with SVN repos?
  • On Windows git: “error: Sparse checkout leaves no entry on the working directory”
  • I can't clone repo on windows with powershell
  • 2 Solutions collect form web for “How can just set write permission (unix chmod 0777) to a folder and git commit it in windows?”

    You cannot. Git does not store the complete permissions for files, it only stores whether a file is executable or not. For folders, it stores no permissions at all.

    Your umask will influence the permissions that are used when folders are created on your local machine, but this is not something that can be committed to the repository.

    Since windows does not use the permissions bit(s) it has no effect under windows.

    One way to “force” git to track those changes is to work with the git Bash which will cause git to work in a Unix like environment and due to that you will be able to track changes made to the file permissions.


    Here is a working demo for you

    enter image description here

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