git repository unmerged branches code example
Example 1: list of unmerged branches
// those not in master
git branch --no-merged master
// those not in current HEAD
git branch --no-merged
git branch -r --no-merged
// compare with origin
git branch -r --no-merged origin/master
Example 2: pull unmerged branch
// If your changes are in a branch on the GitHub repository, you can perform the following steps, assuming that the branch is named feature-branch:
git fetch
git checkout -b feature-branch origin/feature-branch