Skip to content

Commit 49df61f

Browse files
committed
Add more alternatives to get initial commit hash
1 parent be87cde commit 49df61f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,16 @@ __Alternatives:__
551551
git rev-list --max-parents=0 HEAD
552552
```
553553

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+
554564
## Visualize the version tree.
555565
```sh
556566
git log --pretty=oneline --graph --decorate --all

tips.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
}, {
199199
"title": "Retrieve the commit hash of the initial revision.",
200200
"tip": " git rev-list --reverse HEAD | head -1",
201-
"alternatives": ["git rev-list --max-parents=0 HEAD"]
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"]
202202
}, {
203203
"title": "Visualize the version tree.",
204204
"tip": "git log --pretty=oneline --graph --decorate --all",

0 commit comments

Comments
 (0)