From a1a3faecb846d3beb25615475818b4f5beafeb32 Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Tue, 17 Dec 2019 21:31:17 +0100 Subject: [PATCH] git-ls-tree, git-rev-list, git-rev-parse: add pages (#3644) --- pages/common/git-ls-tree.md | 16 ++++++++++++++++ pages/common/git-rev-list.md | 16 ++++++++++++++++ pages/common/git-rev-parse.md | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 pages/common/git-ls-tree.md create mode 100644 pages/common/git-rev-list.md create mode 100644 pages/common/git-rev-parse.md diff --git a/pages/common/git-ls-tree.md b/pages/common/git-ls-tree.md new file mode 100644 index 0000000000..ba67e6878b --- /dev/null +++ b/pages/common/git-ls-tree.md @@ -0,0 +1,16 @@ +# git ls-tree + +> List the contents of a tree object. +> More information: . + +- 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}}` diff --git a/pages/common/git-rev-list.md b/pages/common/git-rev-list.md new file mode 100644 index 0000000000..2ffa1f7c20 --- /dev/null +++ b/pages/common/git-rev-list.md @@ -0,0 +1,16 @@ +# git rev-list + +> List revisions (commits) in reverse chronological order. +> More information: . + +- 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}}` diff --git a/pages/common/git-rev-parse.md b/pages/common/git-rev-parse.md new file mode 100644 index 0000000000..6956fb98ef --- /dev/null +++ b/pages/common/git-rev-parse.md @@ -0,0 +1,16 @@ +# git rev-parse + +> Display metadata related to specific revisions. +> More information: . + +- 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`