Add tip for first commit in a branch

This commit is contained in:
Jorge Marin 2016-06-19 19:50:21 +02:00
parent 93e25eb718
commit 418b227c12
2 changed files with 9 additions and 0 deletions

View File

@ -119,6 +119,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
* [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits)
* [Find lines matching the pattern (regex or string) in tracked files](#find-lines-matching-the-pattern-regex-or-string-in-tracked-files)
* [Clone a shallow copy of a repository](#clone-a-shallow-copy-of-a-repository)
* [Get first commit in a branch (from master)](#get-first-commit-in-a-branch-from-master)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
@ -828,5 +829,10 @@ git grep --heading --line-number 'foo bar'
git clone https://github.com/user/repo.git --depth 1
```
## Get first commit in a branch (from master)
```sh
git log master..<branch-name> --oneline | tail -1
```
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->

View File

@ -361,4 +361,7 @@
}, {
"title": "Clone a shallow copy of a repository",
"tip": "git clone https://github.com/user/repo.git --depth 1"
}, {
"title": "Get first commit in a branch (from master)",
"tip": "git log master..<branch-name> --oneline | tail -1"
}]