Questions tagged [git-ls-tree]
10 questions
115
votes
3 answers
How to read the mode field of git-ls-tree's output
$ git ls-tree fb3a8bdd0ce
100644 blob 63c918c667fa005ff12ad89437f2fdc80926e21c .gitignore
100644 blob 5529b198e8d14decbe4ad99db3f7fb632de0439d .mailmap
100644 blob 6ff87c4664981e4397625791c8ea3bbb5f2279a3 COPYING
040000 tree…

an0
- 17,191
- 12
- 86
- 136
53
votes
5 answers
What is the internal format of a Git tree object?
What is the format of a Git tree object's content?
The content of a blob object is blob [size of string] NUL [string], but what is it for a tree object?

Bystysz
- 681
- 1
- 6
- 8
18
votes
3 answers
git ls-tree output of working directory?
I am looking for a way to have output in the same manner as ls-tree, but of my working directory. Whenever I run git ls-tree . it says fatal: Not a valid object name .

Alexander Bird
- 38,679
- 42
- 124
- 159
2
votes
1 answer
Git : explore folders tructure of old commit without checking it out
I want to look at the folder structure of an old commit that I cannot checkout anymore (it had some Git LFS stuff which is now broken beyond my power to repair it).
I can already diff it to its parent and learn a lot, but I also want to see the…

Charles
- 988
- 1
- 11
- 28
2
votes
2 answers
How to compare local and remote git files?
I need to list all tracked commited files that only exist locally. Let's say my local repo is a commit forward the remote repo (on github or gitlab) and these are my local tracked commited files:
a.txt
b.txt
Now imagine in my remote repo there is…

Fernando Costa
- 669
- 1
- 9
- 31
2
votes
1 answer
Git - List files recursively by branch/tag name
I want to see file trees without cloning all remote files. Is it possible using git commands?
git version 2.21.0
My current commands are below:
- mkdir my-repo && cd my-repo
- git init
- git remote add origin https://remote-repo-url
- git fetch
-…

zakjma
- 2,030
- 12
- 40
- 81
2
votes
1 answer
Alternative to git ls-tree -r HEAD -- . :!foo
I want to retrieve a list of paths, permissions, and content hashes for files for revision in a set of paths, excluding some paths.
git ls-tree seems perfect. For example, in the Git repo,
$ git ls-tree -r v2.2.2 -- Documentation…

Paul Draper
- 78,542
- 46
- 206
- 285
0
votes
1 answer
calculate git worktree hash
I've been using 'git rev-parse HEAD:' to calculate hash of a folder in a worktree.
this is basically the same behavior as 'git ls-tree :'.
this is calculating the hash not of the current worktree, but of a specific commit (HEAD in my case), so…

strabo
- 11
- 1
- 4
0
votes
0 answers
How to list only eixsting files in a git repo?
I used sparse checkout to clone subfolders and files from a repo, as the instructions in this question. Currently, I want to list the checked out files in my disk - not the full repo tree, only the existing files, is there any command can do this?
I…

Terry Chen
- 369
- 3
- 16
0
votes
0 answers
What's the best way to see files of an updated git bare repository? (concept of ls-tree)
I'm looking for a way to see the files on a git bare repository that were updated by other remote but without do a pull in my repository.
I'll try to describe my doubt using an example locally.
I create a folder, add two files and make a new…

zewill
- 181
- 1
- 8