1

Are the numbers for mode (e:g 120000 for link, 100644 for file) are arbitrary or is there any reason for choosing that number?

Krishna
  • 23
  • 1
  • 6

1 Answers1

1

They are not arbitrary, but they are an artifact from when it was expected that Git would store Unix permissions for its contents.

On Unix, "644" is a common default permission for files. It means that the owner has read-write access, and other users have read-only access. Symbolic links do not have permissions, so "000" is used instead.

One exception -- "755" is used for executable files, and this is how Git stores that information.

Dietrich Epp
  • 205,541
  • 37
  • 345
  • 415