Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Git Merged Date Revision Log history?

Tags:

git

merge

git-log

Let say there are 3 branches: A, B, and C.

  • A was merged 2 days ago.

  • B was merged 3 days ago.

  • C was merged 2 weeks ago.

I would like to get the information below from git history:

  1. Git History dated 1 weeks ago

    So, it would only show A, and B.

  2. The retrieved information should only contains:

    a. The revision log when it was merged. For example, revision 45edfe, with the auto comment by GIT like "Merge branch XXXX".

    b. Branch Name if possible.

    c. Merged Date

Thanks

like image 291
Hatjhie Avatar asked Sep 21 '25 10:09

Hatjhie


1 Answers

You can use git log with the --after and --merges switches like this:

git log --after="2015-5-23" --merges

The current date as of writing this answer is 29 May, 2015. The above command will get all merge commits which have happened in the last 7 days (inclusive of 2015-5-23).

A typical git log entry looks like this:

$ git log
commit ca82a6dff817ec66f44342007202690a93763949
Author: Hatjhie <[email protected]>
Date:   Fri May 29 21:52:11 2008 -0700

    Added new UI feature

You typically will run git log for a given branch, and the revision log and branch name are implicitly included.

like image 54
Tim Biegeleisen Avatar answered Sep 23 '25 08:09

Tim Biegeleisen