How do I find out if a branch has been merged?

deathxc 注册会员
2023-02-26 19:35

git branch --merged list of branches merged into the HEAD of the current branch(i.e., the tip of the current branch)

Merged List the branch that has not been merged

git branch --no-merged

By default, only local branches are displayed. Adding -a displays local and remote branches.

git branch -a --merged/no-merged

Add -r to show only remote branches.

git branch -r --merged/no-merged

liuxi123shen 注册会员
2023-02-26 19:35

Generally, there are two cases.
Scenario 1: Returns a list of branches that have been merged into the current branch. merged
git branch -- Merged
Scenario two: Returns a list of branches that have not been merged. merged
git branch --no-merged
Hope to help you.

About the Author

Question Info

Publish Time
2023-02-26 19:35
Update Time
2023-02-26 19:35