How git use blob and tree permissions
If I do git ls-tree branchname path/to/directory
, I get the following output:
100644 blob d7cf85396913fb7169a881d8334f32af153122eb .gitignore
100644 blob ba7adb479be66d8f1d62384ab53997cddd465110 .travis.yml
040000 tree 2de254bbec97958db2375e2d0ab767b23315ab50 application
So, I see the following permissions:
100644 for blobs, 040000 for trees
From what I've read, 100644 can be interpreted as - regular file with sticky bit of 0 and file permissions of 644 (not executable by anyone)
, 040000
- directory with sticky bit of 0 and no permissions
. Instead 644
for blob, it is 755
also possible, as I read git
, to keep track of only executable bits.
My question is, how exactly do I git
use these permissions? Do they apply them to files and folders in the working tree when checking out a branch? Or does he use them somehow internally?
PS. Please note, this question is NOT about what these permissions mean.
source to share
Git uses this permission to determine the type of directory entry at checkout and check the execute permission checkbox if needed. As far as I know, they are not used in any other way.
There are fewer files in git than in the standard posix filesystem:
- 100644: regular files
- 100755: executable files
- 040000: catalogs
- 120,000: symbolic links
source to share