问题
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