tags:

views:

73

answers:

3

How do I list all commits which have not been pushed to the origin yet?

Alternatively, how to determine if a commit with particular hash have been pushed to the origin already?

+5  A: 

git log origin/master..master

or, more generally:

git log <since>..<until>

You can use this with grep to check for a specific, known commit:

git log <since>..<until> | grep <commit-hash>

Or you can also use git-rev-list to search for a specific commit:

git rev-list origin/master | grep <commit-hash>

Dan Moulding
Thanks, this looks obvious now :)
takeshin
+4  A: 

how to determine if a commit with particular hash have been pushed to the origin already?

# list remote branches that contain $commit
git branch -r --contains $commit
Aristotle Pagaltzis
Cool, I didn't know about this. +1
Dan Moulding
A: 

I have found cool script which, among other useful stuff, displays information about unpushed commits:

git-wtf

takeshin