Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check which commits have not been pushed to origin?

Tags:

git

I have made commits to my local branch (let's just say master) and have 'git pull'd down changes that others have made. When I run a 'git status', I see something like:

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

How can I see a list of the four commits that I have made that have yet to be pushed to origin?

like image 568
markdorison Avatar asked Nov 02 '10 21:11

markdorison


People also ask

How do you see commits that will be pushed?

In Git, we can use git show commit_id --name-only to list all the committed files that are going to push to the remote repository.

How do I see all commit history?

`git log` command is used to view the commit history and display the necessary information of the git repository. This command displays the latest git commits information in chronological order, and the last commit will be displayed first.


2 Answers

git diff --stat origin/master 

will show the changed files.

git log origin/master..master 

will show the commits.

like image 139
ebneter Avatar answered Oct 26 '22 20:10

ebneter


I tend to use gitk (or gitk --all) which will show this history of the branch. It also displays large friendly labels on origin/master and master (and any other tags that you have).

A more lo tech version is git log --graph

like image 31
Eric Avatar answered Oct 26 '22 21:10

Eric