mirror of
https://github.com/git-tips/tips.git
synced 2024-09-21 00:01:03 +02:00
Merge pull request #107 from munendrasn/master
Add alternatives to get commit hash of initial revision
This commit is contained in:
commit
9abc547f53
16
README.md
16
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
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue
Block a user