Nabi K.A.Z.
Nabi K.A.Z.

Reputation: 10704

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.

Upvotes: 3

Views: 2534

Answers (2)

CodeWizard
CodeWizard

Reputation: 141946

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

Upvotes: 0

Edward Thomson
Edward Thomson

Reputation: 78623

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.

Upvotes: 2

Related Questions