Add first commit from branch alternative

This commit is contained in:
Diogo Lemos 2018-04-24 20:04:56 +01:00
parent b773c7ab67
commit c46d4a737e
2 changed files with 9 additions and 2 deletions

View File

@ -984,7 +984,13 @@ git log --all --grep='<given-text>'
## Get first commit in a branch (from master)
```sh
git log master..<branch-name> --oneline | tail -1
git log --oneline master..<branch-name> | tail -1
```
__Alternatives:__
```sh
git log --reverse master..<branch-name> | head -6
```
## Unstaging Staged file

View File

@ -395,7 +395,8 @@
"tip": "git log --all --grep='<given-text>'"
}, {
"title": "Get first commit in a branch (from master)",
"tip": "git log master..<branch-name> --oneline | tail -1"
"tip": "git log --oneline master..<branch-name> | tail -1",
"alternatives": ["git log --reverse master..<branch-name> | head -6"]
}, {
"title": "Unstaging Staged file",
"tip": "git reset HEAD <file-name>"