From be87cde44dbd0a1945b6b83662ae25d0041be68c Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Wed, 29 Jun 2016 22:10:25 +0530 Subject: [PATCH 1/2] Add alternatives to get commit hash of initial revision --- README.md | 6 ++++++ tips.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1989cba..cc6d96d 100644 --- a/README.md +++ b/README.md @@ -545,6 +545,12 @@ git remote prune origin git rev-list --reverse HEAD | head -1 ``` + +__Alternatives:__ +```sh +git rev-list --max-parents=0 HEAD +``` + ## Visualize the version tree. ```sh git log --pretty=oneline --graph --decorate --all diff --git a/tips.json b/tips.json index 657b400..3aee552 100644 --- a/tips.json +++ b/tips.json @@ -197,7 +197,8 @@ "alternatives": ["git remote prune origin"] }, { "title": "Retrieve the commit hash of the initial revision.", - "tip": " git rev-list --reverse HEAD | head -1" + "tip": " git rev-list --reverse HEAD | head -1", + "alternatives": ["git rev-list --max-parents=0 HEAD"] }, { "title": "Visualize the version tree.", "tip": "git log --pretty=oneline --graph --decorate --all", From 49df61f4b91f5888ad151ff7137752b651528e32 Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Thu, 30 Jun 2016 23:30:27 +0530 Subject: [PATCH 2/2] Add more alternatives to get initial commit hash --- README.md | 10 ++++++++++ tips.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cc6d96d..1f34272 100644 --- a/README.md +++ b/README.md @@ -551,6 +551,16 @@ __Alternatives:__ git rev-list --max-parents=0 HEAD ``` + +```sh +git log --pretty=oneline | tail -1 | cut -c 1-40 +``` + + +```sh +git log --pretty=oneline --reverse | head -1 | cut -c 1-40 +``` + ## Visualize the version tree. ```sh git log --pretty=oneline --graph --decorate --all diff --git a/tips.json b/tips.json index 3aee552..58aa75b 100644 --- a/tips.json +++ b/tips.json @@ -198,7 +198,7 @@ }, { "title": "Retrieve the commit hash of the initial revision.", "tip": " git rev-list --reverse HEAD | head -1", - "alternatives": ["git rev-list --max-parents=0 HEAD"] + "alternatives": ["git rev-list --max-parents=0 HEAD", "git log --pretty=oneline | tail -1 | cut -c 1-40", "git log --pretty=oneline --reverse | head -1 | cut -c 1-40"] }, { "title": "Visualize the version tree.", "tip": "git log --pretty=oneline --graph --decorate --all",