How to see the commit messages that origin/master

2020-07-18 08:38发布

问题:

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

回答1:

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