Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the possible modes for entries in a Git tree object? [duplicate]

Tags:

git

According to the "Git Internals - Git Objects" chapter of the "Pro Git" book (2nd ed.) each entry in a tree object has a mode.

a mode of 100644 [...] means it’s a normal file. Other options are 100755, which means it’s an executable file; and 120000, which specifies a symbolic link. The mode is taken from normal UNIX modes but is much less flexible — these three modes are the only ones that are valid for files (blobs) in Git (although other modes are used for directories and submodules).

What are the valid modes for directories (=trees?) and submodules (=commits?), and what does each of them mean?

like image 782
Evan Aad Avatar asked Sep 09 '25 12:09

Evan Aad


1 Answers

The other valid modes are:

  • 040000 for trees, and
  • 160000 for submodules

These modes tell how the name is to be used. There is no additional meaning attached to them.

like image 95
j6t Avatar answered Sep 11 '25 05:09

j6t