If I do git log, is there any parameter I could specify to be able to tell from the output which branch every commit belongs to?
Edit: to clarify, I understand that a commit may be part of two branches (for instance). What I want is to get the most recent branch that the commit in log belongs to. So, if I made a branch called foo from master. It would belong to both branches, but I want to get foo.
With
git logyou already get all the commits from the current branch you are on.If you want to see commits from merged branches you can use
To create a log tree and see what merged branches a commit stems from.
--graphwill make the commit tree and--pretty=onelinewill make a one line visualization for every commitTo add branches (as refs) to the log:
To display branches with commits: