Possible Duplicate:
Show the original branch for a commit
I am trying to figure out what happened to a specific file in our Git repo. The file’s change history includes changes on several branches and some merges.
Unfortunately, the best output I can get from git log ... myfile.cs simply shows a graph of changes with not so much as a single branch name anywhere. It would be great if I could see which branch a given change was committed to.
It appears that this might be something that Git doesn’t track. If so, how else might I figure out which branch a change was committed to? If I’m mistaken, how do I persuade git log to show the branch names?
(for the record, --decorate doesn’t do it, presumably because this option only decorates the last change on each branch)
Possible duplicate : Show the original branch for a commit
Given the numerous operations that can happen to a commit (amend, merge, rebase, imported from origin…), I don’t think you can find exactly what you want.
From other SO questions (see here or here), you can have the branches a commit belongs to :