Skip to content

Commit 699b36e

Browse files
authored
Merge pull request #97 from chipironcin/master
Add tip for first commit in a branch
2 parents 4f2b8df + 79da03d commit 699b36e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
120120
* [Find lines matching the pattern (regex or string) in tracked files](#find-lines-matching-the-pattern-regex-or-string-in-tracked-files)
121121
* [Clone a shallow copy of a repository](#clone-a-shallow-copy-of-a-repository)
122122
* [Search Commit log across all branches for given text](#search-commit-log-across-all-branches-for-given-text)
123+
* [Get first commit in a branch (from master)](#get-first-commit-in-a-branch-from-master)
123124

124125
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
125126
<!-- @doxie.inject end toc -->
@@ -834,5 +835,10 @@ git clone https://github.com/user/repo.git --depth 1
834835
git log --all --grep='<given-text>'
835836
```
836837

838+
## Get first commit in a branch (from master)
839+
```sh
840+
git log master..<branch-name> --oneline | tail -1
841+
```
842+
837843
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
838844
<!-- @doxie.inject end -->

tips.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,7 @@
364364
}, {
365365
"title": "Search Commit log across all branches for given text",
366366
"tip": "git log --all --grep='<given-text>'"
367+
}, {
368+
"title": "Get first commit in a branch (from master)",
369+
"tip": "git log master..<branch-name> --oneline | tail -1"
367370
}]

0 commit comments

Comments
 (0)