简体   繁体   English

Git命令查找哪些分支合并到当前分支以及何时合并

[英]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" 我可以输入git log ,它会告诉我合并已经发生但是由于某种原因它没有显示我从哪个功能分支它只是说“merged integration_branch into integration_branch”

I can type git branch --merged 我可以输入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. 我想知道何时和由谁,并能够深入了解这个合并信息。

I would make use of git log with some colours to do this: 我会使用带有一些颜色的git log来做到这一点:

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 有关详细信息,请参阅: http//git-scm.com/book/en/Git-Basics-Viewing-the-Commit-History

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM