hectorsq hectorsq - 1 year ago 129
Git Question

How can I know in git if a branch has been already merged into master?

I have a git repository with multiple branches.

How can I know which branches are already merged into the master branch?

Answer Source

git branch --merged master lists branches merged into master

git branch --merged lists branches merged into HEAD (i.e. tip of current branch)

git branch --no-merged lists branches that have not been merged

By default this applies to only the local branches. The -a flag will show both local and remote branches, and the -r flag shows only the remote branches.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download