ThePyroEagle
ThePyroEagle

Reputation: 153

Git Directory Permissions Always 000

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?

Upvotes: 1

Views: 147

Answers (1)

Miikka
Miikka

Reputation: 4653

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.

Upvotes: 2

Related Questions