Skip to content

Commit 9abc547

Browse files
authored
Merge pull request #107 from munendrasn/master
Add alternatives to get commit hash of initial revision
2 parents 156cbd0 + 49df61f commit 9abc547

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,22 @@ git remote prune origin
545545
git rev-list --reverse HEAD | head -1
546546
```
547547

548+
549+
__Alternatives:__
550+
```sh
551+
git rev-list --max-parents=0 HEAD
552+
```
553+
554+
555+
```sh
556+
git log --pretty=oneline | tail -1 | cut -c 1-40
557+
```
558+
559+
560+
```sh
561+
git log --pretty=oneline --reverse | head -1 | cut -c 1-40
562+
```
563+
548564
## Visualize the version tree.
549565
```sh
550566
git log --pretty=oneline --graph --decorate --all

tips.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@
197197
"alternatives": ["git remote prune origin"]
198198
}, {
199199
"title": "Retrieve the commit hash of the initial revision.",
200-
"tip": " git rev-list --reverse HEAD | head -1"
200+
"tip": " git rev-list --reverse HEAD | head -1",
201+
"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"]
201202
}, {
202203
"title": "Visualize the version tree.",
203204
"tip": "git log --pretty=oneline --graph --decorate --all",

0 commit comments

Comments
 (0)