Take the 2-minute tour ×

Git blame shows a change made to a file. I want to know when that change was merged to our live branch.

I could probably track it down with a graphical client, but there's a lot of other commits going on. The commit was not in the first couple of merges to the live branch.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

git show <commit_hash> will give you details about the commit.

Do this

git rev-list <commit_hash>..<branch> --first-parent

git rev-list <commit_hash>..<branch> --ancestry-path

The last row in common will be the commit hash you're looking for.

You can store them both in a separate file and then do sdiff to quickly identify it.

share|improve this answer
add comment

If I understand correctly, what you want should be this:

git log --merges <interesting_hash>..<live_branch>

That at least seems to work in a one-time merge situation. Not sure how it will act in a continuous integration scenario, where multiple merges from between the two branches might have occurred (although in that case, at least it narrows down the set of places you need to look)...

share|improve this answer
Very nice indeed! –  the.malkolm Dec 5 '12 at 21:49
add comment

Your Answer


