diff --git a/README.md b/README.md index b7d12cd..887d0a1 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [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) * [Search Commit log across all branches for given text](#search-commit-log-across-all-branches-for-given-text) +* [Get first commit in a branch (from master)](#get-first-commit-in-a-branch-from-master) @@ -834,5 +835,10 @@ git clone https://github.com/user/repo.git --depth 1 git log --all --grep='' ``` +## Get first commit in a branch (from master) +```sh +git log master.. --oneline | tail -1 +``` + diff --git a/tips.json b/tips.json index 5d31a3a..4cb4cce 100644 --- a/tips.json +++ b/tips.json @@ -364,4 +364,7 @@ }, { "title": "Search Commit log across all branches for given text", "tip": "git log --all --grep=''" +}, { + "title": "Get first commit in a branch (from master)", + "tip": "git log master.. --oneline | tail -1" }]