Tuesday, August 18, 2026

Git "ls-tree" Command

~/Downloads/gh/private/some_repo (main)
$ git ls-tree

usage: git ls-tree []  [...]

    -d                    only show trees
    -r                    recurse into subtrees
    -t                    show trees when recursing
    -z                    terminate entries with NUL byte
    -l, --long            include object size
    --name-only           list only filenames
    --name-status         list only filenames
    --object-only         list only objects
    --[no-]full-name      use full path names
    --[no-]full-tree      list entire tree; not just current directory (implies --full-name)
    --format      format to use for the output
    --[no-]abbrev[=]   use  digits to display object names


~/Downloads/gh/private/some_repo (main) $ git ls-tree HEAD

100644 blob d0f41b05f672c503eec2111b14f618182389c1ac    .gitignore
040000 tree 2fce9ada01eba23ca60c25703f97e9a0d911333b    HTML
100644 blob 5e3c3c362ce8e9c520d5036dcc2036c182585831    README.md
040000 tree c551779d5363b05aa5a34f211eb68caa2262a986    analytics
040000 tree 52829da05b92a9bf66d890acb90189eba4955445    arize_phoenix_setup
040000 tree bbf89afd34a9ff7f77653881d2ad2d9838931302    blogger_creds
040000 tree f7e789b78a2d2afe9173e22fc8e46b8f1ec14c84    bugs
100644 blob 43defc0854921f22579a4d051cf2ad869bb579c7    chatgpt-kimi-2025Aug.png
040000 tree 891c6c6262971905a698e8885d39f43bd22c09b0    experiment 1
040000 tree a9b3cf308427518614d348cf62b880eb7a22c3f2    experiment 2
100644 blob 63611291cb75fdd49301c8321e9229c93b5a3e73    gemini.png
100644 blob b5e83a0b20588c5bfe22c204cf28b06995d9d427    news_cover_chatgpt_kimi.txt
100644 blob b8c5768d11347230615f35cd83c08fd1cf33c429    news_cover_gemini.txt
040000 tree 3a6d5d80c0ffd5ea943d249aea6e8a5d8f10fa8a    prompts
040000 tree c742432f1a48c523879d508e551db30ce42bef00    sqlite_db

~/Downloads/gh/private/some_repo (main) $ git ls-tree HEAD^


100644 blob d0f41b05f672c503eec2111b14f618182389c1ac    .gitignore
040000 tree 411d3cd1d8082ebbd9b1b7960ce931172650fd2b    HTML
100644 blob 5e3c3c362ce8e9c520d5036dcc2036c182585831    README.md
040000 tree c551779d5363b05aa5a34f211eb68caa2262a986    analytics
040000 tree 52829da05b92a9bf66d890acb90189eba4955445    arize_phoenix_setup
040000 tree c30b567ab1de2929bf4d6e906693a95d01ac269f    blogger_creds
040000 tree f7e789b78a2d2afe9173e22fc8e46b8f1ec14c84    bugs
100644 blob 43defc0854921f22579a4d051cf2ad869bb579c7    chatgpt-kimi-2025Aug.png
040000 tree f766fd0de8015e29dacce7e221547bc400b0d192    experiment 1
040000 tree a9b3cf308427518614d348cf62b880eb7a22c3f2    experiment 2
100644 blob 63611291cb75fdd49301c8321e9229c93b5a3e73    gemini.png
100644 blob b5e83a0b20588c5bfe22c204cf28b06995d9d427    news_cover_chatgpt_kimi.txt
100644 blob b8c5768d11347230615f35cd83c08fd1cf33c429    news_cover_gemini.txt
040000 tree 3a6d5d80c0ffd5ea943d249aea6e8a5d8f10fa8a    prompts
040000 tree 9e74c0b357a557e5602cbd115158d51493f672df    sqlite_db

~/Downloads/gh/private/some_repo (main)
$ git ls-tree HEAD HTML

040000 tree 2fce9ada01eba23ca60c25703f97e9a0d911333b    HTML

~/Downloads/gh/private/some_repo (main)
$ git ls-tree HEAD HTML/


100644 blob bd269ece__<40 Chars Long SHA Code>    HTML/19_Dropped_Out...
100644 blob 56aea3dd__<40 Chars Long SHA Code>    HTML/1_BHK_Full_Rig...

...
...
...

100644 blob fd179359__<40 Chars Long SHA Code>    HTML/Access_Denied_...
100644 blob 07eebeaf__<40 Chars Long SHA Code>    HTML/Afghanistans_D...

No comments:

Post a Comment