Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

bitbucket

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

like image 845
tom Avatar asked Jun 02 '15 16:06

tom


People also ask

How do you see commits that haven't been pushed?

We can view the unpushed git commits using the git command. It will display all the commits that are made locally but not pushed to the remote git repository.

How do you find all the commits made on a branch?

On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.


1 Answers

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 
like image 96
Aleksander Monk Avatar answered Oct 02 '22 06:10

Aleksander Monk