Does git store the read, write, execute permissions for files?

前端 未结 2 631
滥情空心
滥情空心 2020-12-15 05:10

I wanted to make some files in git read only. But I couldn\'t find any good documentation on doing this.

Does git store the read, write, execute permissions

相关标签:
2条回答
  • 2020-12-15 05:32

    According to kernel.org git does not store all the permissions possible for files.

    Git is a content tracker, where content is de facto defined as "whatever is relevant to the state of a typical sourcecode tree". Basically, this is just files' data and "executable" attribute.

    So git stores only the content in the file and the execute bit.

    (This is probably a design choice. Probably driven partly by the fact that not all file systems are the same.)

    0 讨论(0)
  • 2020-12-15 05:38

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

    0 讨论(0)
提交回复
热议问题