Skip to content

Instantly share code, notes, and snippets.

@hughdbrown
Created January 15, 2024 19:07
Show Gist options
  • Save hughdbrown/c221564e59f147cbfba606ab06c2a878 to your computer and use it in GitHub Desktop.
Save hughdbrown/c221564e59f147cbfba606ab06c2a878 to your computer and use it in GitHub Desktop.
Git filemodes
❯ ls -alrt
total 0
drwxr-xr-x  152 hughbrown  staff  4864 Jan 15 12:00 ..
drwxr-xr-x    9 hughbrown  staff   288 Jan 15 12:00 .git
-rw-r--r--    1 hughbrown  staff     0 Jan 15 12:00 x644
-rwxr-xr-x    1 hughbrown  staff     0 Jan 15 12:01 x755
-rw-------    1 hughbrown  staff     0 Jan 15 12:01 x600
drwxr-xr-x    6 hughbrown  staff   192 Jan 15 12:01 .
❯ git add x*
❯ git commit -m "Test"
[main (root-commit) 20ccae4] Test
 4 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 x600
 create mode 100644 x644
 create mode 100755 x700
 create mode 100755 x755
❯ git ls-tree  20ccae46083ae580d1e1bdd5c31e9dc29d3bbafe
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    x600
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    x644
100755 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    x700
100755 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    x755
@hughdbrown
Copy link
Author

> mkdir y
> touch y/y
> git add y/y
> git commit -m "Test"
[main 7188628] Test
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 y/y
> git ls-tree 71886289735fd5d4d5348b8a2d91eed8c1b05f87
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    x600
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    x644
100755 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    x700
100755 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    x755
040000 tree 50a0bf73442df4add7d727ed3ebbc4176c8c19be    y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment