If the branch is explicitly merged, just git branch -d xxx will do. If merge is not displayed, this command will not be executed.
But some branches may be implicitly merged, that is, their code is merged into the trunk (merge --squash/rebase), but no explicit merge is performed. What should I do in this case? For example, this branch is called feature, and the trunk is master
Try:
-
git branch --merged
-
git branch --no-merged
You can also try
git log | grep branch_name
Recommend a tool tig
The effect is as follows:
Capital
M
代表的就是merge
操作,这样看应该很清晰吧,每个分支的历史都可以看得清清楚楚,当然号称git
浏览器的tig
does more than that, it has many more powerful features and is worth using.If the branch is explicitly merged, just git branch -d xxx will do. If merge is not displayed, this command will not be executed.
But some branches may be implicitly merged, that is, their code is merged into the trunk (merge --squash/rebase), but no explicit merge is performed. What should I do in this case? For example, this branch is called feature, and the trunk is master