From 418b227c124a3082eeb3d7547cf1589e20528a58 Mon Sep 17 00:00:00 2001 From: Jorge Marin Date: Sun, 19 Jun 2016 19:50:21 +0200 Subject: [PATCH] Add tip for first commit in a branch --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index fa7c93d..cbab932 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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.. --oneline | tail -1 +``` + diff --git a/tips.json b/tips.json index 571cd52..bc5a7dc 100644 --- a/tips.json +++ b/tips.json @@ -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.. --oneline | tail -1" }]