Thursday, October 23, 2014

Git Tip: find unmerged branches


Here is handy little git command to find merged or unmerged branches.

The command is as follows

git branch <whereToLook> --merged <branch>
Where to look can be :
  • -l locally (default)
  • -r remotely
  • -a both
branch
  • The branch to check. The default is your current branch.

To find merged branches both (remotely and locally)

git branch -a --merged

To find unmerged branches remotely and locally)
git branch -a --no-merged
To find unmerged branches we append the merged command with no

If you don't specify a branch it will default to your current branch.

No comments: