Have you ever noticed that when git mentions a file it often shows an octal permission mode that doesn’t match with the permission on the file?
No? Try this, from an empty directory:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
So I just added a file to git that has octal perms of 0664
but git reported 100644
- it’s safe to ignore the prefix, but why has the second last digit changed?
Here’s something else to try:
1 2 3 4 5 6 7 8 |
|
So git took all 256 different combinations of modes we gave it and stored 100644
half the time and 100755
the other half.
This is because git is really only looking at the u+x
(user execute aka & 0100
) bit - it doesn’t care about the rest of the perms.