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 @@ -119,6 +119,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
119
119
* [ Show all local branches ordered by recent commits] ( #show-all-local-branches-ordered-by-recent-commits )
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
+ * [ Get first commit in a branch (from master)] ( #get-first-commit-in-a-branch-from-master )
122
123
123
124
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
124
125
<!-- @doxie.inject end toc -->
@@ -828,5 +829,10 @@ git grep --heading --line-number 'foo bar'
828
829
git clone https://github.com/user/repo.git --depth 1
829
830
```
830
831
832
+ ## Get first commit in a branch (from master)
833
+ ``` sh
834
+ git log master..< branch-name> --oneline | tail -1
835
+ ```
836
+
831
837
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
832
838
<!-- @doxie.inject end -->
Original file line number Diff line number Diff line change 361
361
}, {
362
362
"title" : " Clone a shallow copy of a repository" ,
363
363
"tip" : " git clone https://github.com/user/repo.git --depth 1"
364
+ }, {
365
+ "title" : " Get first commit in a branch (from master)" ,
366
+ "tip" : " git log master..<branch-name> --oneline | tail -1"
364
367
}]
You can’t perform that action at this time.
0 commit comments