From 49df61f4b91f5888ad151ff7137752b651528e32 Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Thu, 30 Jun 2016 23:30:27 +0530 Subject: [PATCH] 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",