File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
120
120
* [ Find lines matching the pattern (regex or string) in tracked files] ( #find-lines-matching-the-pattern-regex-or-string-in-tracked-files )
121
121
* [ Clone a shallow copy of a repository] ( #clone-a-shallow-copy-of-a-repository )
122
122
* [ 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 )
123
124
124
125
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
125
126
<!-- @doxie.inject end toc -->
@@ -834,5 +835,10 @@ git clone https://github.com/user/repo.git --depth 1
834
835
git log --all --grep=' <given-text>'
835
836
```
836
837
838
+ ## Get first commit in a branch (from master)
839
+ ``` sh
840
+ git log master..< branch-name> --oneline | tail -1
841
+ ```
842
+
837
843
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
838
844
<!-- @doxie.inject end -->
Original file line number Diff line number Diff line change 364
364
}, {
365
365
"title" : " Search Commit log across all branches for given text" ,
366
366
"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"
367
370
}]
You can’t perform that action at this time.
0 commit comments