5

When git informs me that my local branch is behind master, how do I tell git to print out the log messages that I am behind on. For example, in the situation below how do I view the log messages of the 2 commits on origin/master that I don't have on master?

git status
# On branch master
# Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
#
nothing to commit, working directory clean
ams
  • 60,316
  • 68
  • 200
  • 288

1 Answers1

10

You can try (following "Git diff .. ? What's the difference between having .. and no dots"):

 git log master..origin/master

Which is the same as:

git log origin/master ^master

(show me the commits on origin/master which are not -- '^' -- on master)

git log dots

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • awesome answer, thanks, this is so much better than the man pages for git! thank you. – ams Jan 20 '13 at 17:17
  • @ams: yes, it is all about commit range: http://git-scm.com/book/ch6-1.html#Commit-Ranges – VonC Jan 20 '13 at 17:18
  • @ams: it is also well explained in [the `gitrevisions` man page](http://git-scm.com/docs/gitrevisions.html) (along with all other commit operators in git) – Nevik Rehnel Jan 20 '13 at 20:21