-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-ls-tree, git-rev-list, git-rev-parse: add pages (#3644)
- Loading branch information
1 parent
a5f9109
commit a1a3fae
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 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}}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# git rev-list | ||
|
||
> List revisions (commits) in reverse chronological order. | ||
> More information: <https://git-scm.com/docs/git-rev-list>. | ||
- List all commits on the current branch: | ||
|
||
`git rev-list {{HEAD}}` | ||
|
||
- List commits more recent than a specific date, on a specific branch: | ||
|
||
`git rev-list --since={{'2019-12-01 00:00:00'}} {{master}}` | ||
|
||
- List all merge commits on a specific commit: | ||
|
||
`git rev-list --merges {{commit}}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# git rev-parse | ||
|
||
> Display metadata related to specific revisions. | ||
> More information: <https://git-scm.com/docs/git-rev-parse>. | ||
- Get the commit hash of a branch: | ||
|
||
`git rev-parse {{branch_name}}` | ||
|
||
- Get the current branch name: | ||
|
||
`git rev-parse --abbrev-ref {{HEAD}}` | ||
|
||
- Get the absolute path to the root directory: | ||
|
||
`git rev-parse --show-toplevel` |