Randnum
Randnum

Reputation: 1360

Git command to find what branches were merged into current branch and when

I have several feature branches that are being automatically merged into the integration branch. I'd like to know if and when this is happening.

I can type git log which will show me that a merge has happened but for some reason it does not show me from which feature branch it just says "merged integration_branch into integration_branch"

I can type git branch --merged

but that only lists the feature branches that are being merged into the integration branch. I'd like to know when and by whom, and be able to drill down into this merge information.

Upvotes: 9

Views: 4893

Answers (1)

Ilion
Ilion

Reputation: 6872

I would make use of git log with some colours to do this:

git log --graph --full-history --all --color \ 
--pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"

This will colour each branch and the merges. It will also label the head of each branch.

You can add relative dates and committer names with this:

git log --graph --full-history --all --color \
--pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s \
%Cgreen(%cr) %C(bold blue)<%an>%Creset'"

For more info see: http://git-scm.com/book/en/Git-Basics-Viewing-the-Commit-History

Upvotes: 10

Related Questions