Does git retain read, write, execute permissions for files?

I wanted to make some files in git read-only. But I could not find good documentation about this.

Does git support read, write, execute permissions for files?

+10
git file-permissions permissions
source share
2 answers

According to kernel.org, git does not save all permissions available to files.

Git is a content tracker where the content is de facto defined as "everything that relates to the state of a typical source tree." In principle, this is only file data and the attribute "executable".

So git only stores the contents in the file and the execution bit.

(Perhaps this is a design choice. This is probably partly due to the fact that not all file systems are the same.)

+12
source share

git update-index --chmod = + x foo.sh

0
source share

All Articles