Questions tagged [git-ls-tree]
The git-ls-tree tag has no usage guidance.
git-ls-tree
12
questions
0
votes
1
answer
90
views
git ls-tree: aggregate sibling paths into single hash?
With git ls-tree I can get hash of some content inside repository by its commit.
Like:
git ls-tree HEAD path1 --object-only
hash1
git ls-tree HEAD path2 --object-only
hash2
Is there a way to ...
2
votes
1
answer
281
views
How to get the tree of the current directory in Git
In Git it's possible to get the tree of a sub-directory, say foo/ like this
git ls-tree -d HEAD foo
but suppose foo is the current directory, how does one get the tree of that directory?
The ...
2
votes
1
answer
374
views
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 ...
0
votes
1
answer
209
views
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 ...
2
votes
2
answers
538
views
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....
2
votes
1
answer
240
views
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
- ...
0
votes
0
answers
59
views
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 ...
0
votes
0
answers
77
views
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 ...
2
votes
1
answer
231
views
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-...
59
votes
5
answers
24k
views
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?
19
votes
3
answers
36k
views
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 .
117
votes
3
answers
37k
views
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 ...