diff --git a/README.md b/README.md index 0ddf0f2..e3a01e4 100644 --- a/README.md +++ b/README.md @@ -545,6 +545,22 @@ git remote prune origin git rev-list --reverse HEAD | head -1 ``` + +__Alternatives:__ +```sh +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 dfc4bde..09c3595 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", "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",