简体   繁体   中英

How can I check whether a branch has been merged into another branch?

在命令行中,如何检查分支是否已合并到另一个分支,如果是,请找出它已合并到哪个分支?

git branch --contains <branch>

将打印所有本地分支,其中<branch>标记的提交是祖先。

if your do something like

git checkout a
git merge b

you will merge b into a

when your merge you are creating a merge commit so you should be able to see the commit in

 git log

You can use gitg for this. See also visual editor .

With --contains , shows only the branches that contain the named commit (in other words, the branches whose tip commits are descendants of the named commit)

--contains []
Only list branches which contain the specified commit (HEAD if not specified)

git branch --contains <commit/tag/branch>

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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