Printing unverified branches

How can I print which of my git branches has unlocked commits? I don't care what the commits contain, but they just might push there.

I would like to see something like:

# On branch master # Your branch is ahead of 'origin/master' by 2 commits. 

or nothing at all if the local and remote branches are in the same place.

+4
source share
1 answer

git branch -vv

All your local branches will be listed here along with their remotes, letting you know what their status is (if they are in front, behind, or both).

To make sure you are updated for all branches, be sure to do git fetch

If you want to see only branches that you can follow, follow these steps:

 git branch -vv | grep ahead 
+5
source

Source: https://habr.com/ru/post/1490316/


All Articles