问题描述
040000 DirEntry hash
04表示它是一个目录,但权限是000。意味着Git不存储树权限,或者是Unix如何工作? Git不存储树对象的权限,即使目录Unix文件系统确实拥有它们。对于文件,git只存储可执行位(+ x)。所有文件都被认为是可读写的。这意味着只有您将看到blob的模式是 100644
(不可执行)和 100755
(可执行文件)。
有关更多信息,请参见例如有关。
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?
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.
这篇关于Git目录权限始终为000的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!