Git Directory Permissions Always 000

陌路散爱 提交于 2020-01-25 06:21:05

问题


By messing around with Git objects, I've found that the tree entries within a tree object always have these permissions.

040000 DirEntry hash

The 04 means that it is a directory, but the permissions are 000. Does this mean that Git does not store tree permissions, or is that how Unix works?


回答1:


Yeah. Git does not store permissions for tree objects, even though directories Unix filesystems do have them. For files, git only stores the executable bit (+x). All files are assumed to be readable and writable. This means that only modes you'll see for blobs are 100644 (not executable) and 100755 (executable).

For more information, see e.g. the documentation on what git stores in the index file.



来源:https://stackoverflow.com/questions/27886065/git-directory-permissions-always-000

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!