Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List Git commits not pushed to the origin yet [duplicate]

Tags:

git

Possible Duplicate:
Viewing Unpushed Git Commits

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?

like image 525
takeshin Avatar asked Jun 20 '10 18:06

takeshin


People also ask

How do you see what has been committed git?

To find out which files changed in a given commit, use the git log --raw command. It's the fastest and simplest way to get insight into which files a commit affects.


2 Answers

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>

like image 77
Dan Moulding Avatar answered Oct 15 '22 03:10

Dan Moulding


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 
like image 34
Aristotle Pagaltzis Avatar answered Oct 15 '22 02:10

Aristotle Pagaltzis