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

GitBitbucket

Git Problem Overview


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).

Git Solutions


Solution 1 - Git

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 of branch main

git log origin/main..main

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiontomView Question on Stackoverflow
Solution 1 - GitAleksander MonkView Answer on Stackoverflow