Git Directory Permissions Always 000
Asked Answered
P

1

1

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?

Pic answered 11/1, 2015 at 10:30 Comment(0)
A
2

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.

Ailanthus answered 11/1, 2015 at 10:59 Comment(1)
Correct link is github.com/git/git/blob/master/Documentation/…Icosahedron

© 2022 - 2024 — McMap. All rights reserved.