I have created a branch for testing in my local repo (test-branch) which I pushed to Github.

If I go to my Github account and select this test-branch it shows the info:

This branch is 1 commit ahead and 2 commits behind master

My questions are:

  1. How can I display this info locally (ie: a command that shows this on the terminal, rather than having to open Github to see it)?
  2. I know I can see the diffs between branches using:

    git diff master..test-branch
    

    or using Meld (which I prefer):

    git difftool master..test-branch
    

    but I was wondering if there’s a way to see the ahead and behind commits separately. I.E.: is there a way to show that 1 commit ahead by itself and then those 2 commits behind by themselves?

6 Answers
6

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *