From e437c4f04c4f51e398889f558a47e3f4793f6d3c Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Thu, 5 Dec 2019 12:14:46 +0100 Subject: [PATCH 01/11] git-ls-tree: add page --- pages/common/git-ls-tree.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pages/common/git-ls-tree.md diff --git a/pages/common/git-ls-tree.md b/pages/common/git-ls-tree.md new file mode 100644 index 00000000000000..d30f7c671829e5 --- /dev/null +++ b/pages/common/git-ls-tree.md @@ -0,0 +1,12 @@ +# git ls-tree + +> List the contents of a tree object. +> More information: . + +- List the contents of the tree on a branch: + +`git ls-tree {{master}}` + +- List the contents of the tree on a commit, recurse into subtrees, and show only filenames: + +`git ls-tree -r --name-only {{c39ab84d}}` From 6d99b185d42e8e154e8908e6dbf9eaf48131ad17 Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Thu, 5 Dec 2019 15:06:39 +0100 Subject: [PATCH 02/11] git-rev-list: add page --- pages/common/git-rev-list.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pages/common/git-rev-list.md diff --git a/pages/common/git-rev-list.md b/pages/common/git-rev-list.md new file mode 100644 index 00000000000000..b041d293f5f615 --- /dev/null +++ b/pages/common/git-rev-list.md @@ -0,0 +1,16 @@ +# git rev-list + +> Lists commits in reverse chronological order. +> More information: . + +- List all commits on 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}}` From fa7e8f3ef66207dee96265ca7a1fc0a048dc60d2 Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Thu, 5 Dec 2019 16:33:20 +0100 Subject: [PATCH 03/11] git-rev-parse: add page --- pages/common/git-rev-parse.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pages/common/git-rev-parse.md diff --git a/pages/common/git-rev-parse.md b/pages/common/git-rev-parse.md new file mode 100644 index 00000000000000..52ea8179654092 --- /dev/null +++ b/pages/common/git-rev-parse.md @@ -0,0 +1,12 @@ +# git rev-parse + +> Parses a revision. +> More information: . + +- Get the absolute path to the root directory: + +`git rev-parse --show-toplevel` + +- Get the current branch name: + +`git rev-parse --abbrev-ref {{HEAD}}` From 35035345650e07534a454774f0aa987ca60c6124 Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Thu, 5 Dec 2019 20:03:49 +0100 Subject: [PATCH 04/11] git-ls-tree: use 1 option per example --- pages/common/git-ls-tree.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pages/common/git-ls-tree.md b/pages/common/git-ls-tree.md index d30f7c671829e5..1439fa6d5c9bbf 100644 --- a/pages/common/git-ls-tree.md +++ b/pages/common/git-ls-tree.md @@ -5,8 +5,12 @@ - List the contents of the tree on a branch: -`git ls-tree {{master}}` +`git ls-tree {{branch_name}}` -- List the contents of the tree on a commit, recurse into subtrees, and show only filenames: +- List the contents of the tree on a commit and recurse into subtrees: -`git ls-tree -r --name-only {{c39ab84d}}` +`git ls-tree -r {{commit_hash}}` + +- List the contents of the tree on a commit and show only filenames: + +`git ls-tree --name-only {{HEAD~3}}` From a2c3e613135cec75a31027ea1e7dc6535dd1c46a Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Thu, 5 Dec 2019 20:27:44 +0100 Subject: [PATCH 05/11] git-ls-tree: improve example --- pages/common/git-ls-tree.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/common/git-ls-tree.md b/pages/common/git-ls-tree.md index 1439fa6d5c9bbf..6079fcdcdf8fd3 100644 --- a/pages/common/git-ls-tree.md +++ b/pages/common/git-ls-tree.md @@ -11,6 +11,6 @@ `git ls-tree -r {{commit_hash}}` -- List the contents of the tree on a commit and show only filenames: +- List the contents of the tree {{N}} commits ago and show only filenames: -`git ls-tree --name-only {{HEAD~3}}` +`git ls-tree --name-only {{HEAD}}~{{N}}` From 5ca4a8b553e7ab2d4ab535138b6bb2dd5508d79d Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Fri, 6 Dec 2019 18:28:02 +0100 Subject: [PATCH 06/11] git-ls-tree: improve wording Co-Authored-By: Waldir Pimenta --- pages/common/git-ls-tree.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/git-ls-tree.md b/pages/common/git-ls-tree.md index 6079fcdcdf8fd3..aaeded7b5079e0 100644 --- a/pages/common/git-ls-tree.md +++ b/pages/common/git-ls-tree.md @@ -7,7 +7,7 @@ `git ls-tree {{branch_name}}` -- List the contents of the tree on a commit and recurse into subtrees: +- List the contents of the tree on a commit, recursing into subtrees: `git ls-tree -r {{commit_hash}}` From 3923a26b0f1ffe04e37f7fb476d1add4d92bdf87 Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Fri, 6 Dec 2019 18:46:06 +0100 Subject: [PATCH 07/11] git-rev-parse: add basic example --- pages/common/git-rev-parse.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pages/common/git-rev-parse.md b/pages/common/git-rev-parse.md index 52ea8179654092..2bceb72aef8ac7 100644 --- a/pages/common/git-rev-parse.md +++ b/pages/common/git-rev-parse.md @@ -3,10 +3,14 @@ > Parses a revision. > More information: . -- Get the absolute path to the root directory: +- Get the commit hash of a branch: -`git rev-parse --show-toplevel` +`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` From 4c51e2c6703f53ad9dfb538f3988801ca5aa2d17 Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Fri, 6 Dec 2019 18:48:28 +0100 Subject: [PATCH 08/11] git-rev-list: improve wording Co-Authored-By: Waldir Pimenta --- pages/common/git-rev-list.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/git-rev-list.md b/pages/common/git-rev-list.md index b041d293f5f615..240513f66e91d2 100644 --- a/pages/common/git-rev-list.md +++ b/pages/common/git-rev-list.md @@ -3,7 +3,7 @@ > Lists commits in reverse chronological order. > More information: . -- List all commits on current branch: +- List all commits on the current branch: `git rev-list {{HEAD}}` From 3dc463b5a70d58485f5e7a87387563bc9302e854 Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Fri, 6 Dec 2019 18:50:58 +0100 Subject: [PATCH 09/11] git-rev-list: prevent misunderstanding --- pages/common/git-rev-list.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/git-rev-list.md b/pages/common/git-rev-list.md index 240513f66e91d2..2ffa1f7c208953 100644 --- a/pages/common/git-rev-list.md +++ b/pages/common/git-rev-list.md @@ -1,6 +1,6 @@ # git rev-list -> Lists commits in reverse chronological order. +> List revisions (commits) in reverse chronological order. > More information: . - List all commits on the current branch: From 98a60c0d11b1013b8cb92f0720abb20674fc9b75 Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Sat, 7 Dec 2019 20:52:51 +0100 Subject: [PATCH 10/11] git-rev-parse: rephrase description --- pages/common/git-rev-parse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/git-rev-parse.md b/pages/common/git-rev-parse.md index 2bceb72aef8ac7..6956fb98efe48f 100644 --- a/pages/common/git-rev-parse.md +++ b/pages/common/git-rev-parse.md @@ -1,6 +1,6 @@ # git rev-parse -> Parses a revision. +> Display metadata related to specific revisions. > More information: . - Get the commit hash of a branch: From d3cccfffc26bea964548c255666f92162627ac73 Mon Sep 17 00:00:00 2001 From: Valentin Vetter Date: Tue, 10 Dec 2019 20:48:17 +0100 Subject: [PATCH 11/11] git-ls-tree: improve example --- pages/common/git-ls-tree.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/common/git-ls-tree.md b/pages/common/git-ls-tree.md index aaeded7b5079e0..ba67e6878b6112 100644 --- a/pages/common/git-ls-tree.md +++ b/pages/common/git-ls-tree.md @@ -11,6 +11,6 @@ `git ls-tree -r {{commit_hash}}` -- List the contents of the tree {{N}} commits ago and show only filenames: +- List only the filenames of the tree on a commit: -`git ls-tree --name-only {{HEAD}}~{{N}}` +`git ls-tree --name-only {{commit_hash}}`