Search code examples
gitgithubgithub-for-mac

How to check if all my branches are equal to master branch?


I would like to know if there is a command which can check if all my branches are equal to the master branch.

I have a Github repo and I have many branches and sometimes I forgot if I did a "git rebase" on a given branch. For now it's okay, but later I will add many branches and it's boring to check each branch.

If someone has the solution, thanks :) The Github repo


Solution

  • Locally, you can use git merge-base to compare your branch with master: if the result if master HEAD, that means your branch is equals to or rebased onto master.

    You can see an example applied to all branches in "Is it possible to filter out merged branches in git for-each-ref?"


    On GitHub, you can compare branches, but that would have to be done branch by branch.