mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-15 01:48:40 +00:00
Update cheatsheets
This commit is contained in:
25
git-ls-tree
Normal file
25
git-ls-tree
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# git ls-tree
|
||||
|
||||
> List the contents of a tree object.
|
||||
> More information: <https://git-scm.com/docs/git-ls-tree>.
|
||||
|
||||
- List the contents of the tree on a branch:
|
||||
|
||||
`git ls-tree {{branch_name}}`
|
||||
|
||||
- List the contents of the tree on a commit, recursing into subtrees:
|
||||
|
||||
`git ls-tree -r {{commit_hash}}`
|
||||
|
||||
- List only the filenames of the tree on a commit:
|
||||
|
||||
`git ls-tree --name-only {{commit_hash}}`
|
||||
|
||||
- Print the filenames of the current branch head in a tree structure (Note: `tree --fromfile` is not supported on Windows):
|
||||
|
||||
`git ls-tree -r --name-only HEAD | tree --fromfile`
|
||||
Reference in New Issue
Block a user