Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewing unpushed Git commits

How can I view any local commits I've made, that haven't yet been pushed to the remote repository? Occasionally, git status will print out that my branch is X commits ahead of origin/master, but not always.

Is this a bug with my install of Git, or am I missing something?

like image 410
Josh Buhler Avatar asked Jan 06 '10 22:01

Josh Buhler


People also ask

How do I see all my commits?

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.

Can others see my commits in git?

This is not possible by definition. A commit that someone else hasn't pushed is local to their machine. The only way to see unpushed commits would be to log into whatever machine they are working on, and cd into their working directory if they're willing to let you do that.


1 Answers

git log origin/master..HEAD 

You can also view the diff using the same syntax

git diff origin/master..HEAD 
like image 113
Peter B Avatar answered Oct 20 '22 04:10

Peter B