Back

Explore Courses Blog Tutorials Interview Questions
+2 votes
2 views
in DevOps and Agile by (19.4k points)
edited by

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?

2 Answers

+1 vote
by (27.5k points)
edited by

Say, you performed a commit but did not push it to any branch. Use this to see what that commit was:

git reflog

For more information please go through the following tutorial to get more info about git:

 

+2 votes
by (62.9k points)

You can try this:

git log origin/master..HEAD

You can also view the diff using the same syntax

git diff origin/master..HEAD

Related questions

0 votes
1 answer
0 votes
1 answer

Browse Categories

...