Skip to content

Commit 3853ef2

Browse files
authored
Merge pull request #162 from dmlemos/master
Add alternative for first commit from branch
2 parents b773c7a + c46d4a7 commit 3853ef2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,13 @@ git log --all --grep='<given-text>'
984984

985985
## Get first commit in a branch (from master)
986986
```sh
987-
git log master..<branch-name> --oneline | tail -1
987+
git log --oneline master..<branch-name> | tail -1
988+
```
989+
990+
991+
__Alternatives:__
992+
```sh
993+
git log --reverse master..<branch-name> | head -6
988994
```
989995

990996
## Unstaging Staged file

tips.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@
395395
"tip": "git log --all --grep='<given-text>'"
396396
}, {
397397
"title": "Get first commit in a branch (from master)",
398-
"tip": "git log master..<branch-name> --oneline | tail -1"
398+
"tip": "git log --oneline master..<branch-name> | tail -1",
399+
"alternatives": ["git log --reverse master..<branch-name> | head -6"]
399400
}, {
400401
"title": "Unstaging Staged file",
401402
"tip": "git reset HEAD <file-name>"

0 commit comments

Comments
 (0)