From e9e75fed9e1dfc07c914a2d7a960165f82db5ef4 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 28 Aug 2015 18:17:40 +0530 Subject: [PATCH] commit hash of the initial revision --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index b968ab2..e922e68 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ * [Archive the `master` branch](https://github.com/git-tips/tips#archive-the-master-branch) * [Modify previous commit without modifying the commit message](https://github.com/git-tips/tips#modify-previous-commit-without-modifying-the-commit-message) * [Purnes branches that have been deleted in the remote.](https://github.com/git-tips/tips#purnes-branches-that-have-been-deleted-in-the-remote) +* [Retrieve the commit hash of the initial revision.](https://github.com/git-tips/tips#retrieve-the-commit-hash-of-the-initial-revision) @@ -383,5 +384,10 @@ __Alternatives:__ git remote prune origin ``` +## Retrieve the commit hash of the initial revision. +```sh + git rev-list --reverse HEAD | head -1 +``` + diff --git a/tips.json b/tips.json index 8f909b2..377c461 100644 --- a/tips.json +++ b/tips.json @@ -213,5 +213,9 @@ "title": "Purnes branches that have been deleted in the remote.", "tip": "git fetch -p", "alternatives":["git remote prune origin"] + }, + { + "title": "Retrieve the commit hash of the initial revision.", + "tip": " git rev-list --reverse HEAD | head -1" } ]