I have a git repository for a project at work. Each time we release a version of our software, we create a release branch for it. There’s a release1.0 branch, a release 1.1 branch, etc. When we need to create a hotfix for that release, we commit the fix to that release branch, and then we merge that fix into our master development branch.
Sometimes we forget that last step in our rush to fix a production bug, and then a new release goes out without the hotfix for our previous problem.
Is there an easy git command that checks to see if all our our release branches have been merged into master, and if not, which commits in which branches?
You could try
git branch --no-merged master. This should list all branches that haven’t been merged intomaster.Another approach is to type
git log master..branch, which will show empty results if branch is merged into master, and will otherwise present a list of unmerged commits.