GIT: Branch is Not Fully Merged

05-10-2021

There are times when you get an “not fully merged” error for a git branch, usually when trying to delete a local branch from your machine. It’s a safe bet that something in your local branch has not actually made it to the remote repository and we should do some investigating.

If you want to find out what commits have not been merged from your source branch to a target branch, use the git log command.

1
git log <source branch> --not <target branch>

Example Use:

1
git log feature/add-something-amazing --not main

If you want to know what files have changed as part of each commit, add the --stat flag.

1
git log feature/add-something-amazing --not main --stat