How to see all local commits which are not pushed to the remote branch?

tom picture tom · Jun 2, 2015 · Viewed 86.3k times · Source

I am using the following commands to see all the local commits which are not pushed to remote branch but I am not getting all those local commits.

 git log  
 git log origin/master..master  

I want to see at-least 10 local commits(only local).

Answer

Aleksander Monk picture Aleksander Monk · Jun 2, 2015

This will show you all not pushed commits from all branches

git log --branches --not --remotes

and this will show you all your local commits

git log origin/master..HEAD