You can use a range to do that.
git log master..
If you've checked out your my_experiment branch. This will compare where master is at to HEAD (the tip of my_experiment).
Videos
What is the difference between `git log` and `git reflog`?
How do I find a commit by its message?
How do I show a single commit in full detail?
You can use a range to do that.
git log master..
If you've checked out your my_experiment branch. This will compare where master is at to HEAD (the tip of my_experiment).
Note: if you limit that log to the last n commit (last 3 commits for instance, git log -3), make sure to put a space between 'n' and your branch:
git log -3 master..
Before Git 2.1 (August 2014), this mistake: git log -3master.. would actually show you the last 3 commits of the current branch (here my_experiment), ignoring the master limit (meaning if my_experiment contains only one commit, 3 would still be listed, 2 of them from master)
See commit e3fa568 by Junio C Hamano (gitster):
revision: parse "git log -<count>" more carefully
This mistyped command line simply ignores "
master" and ends up showing two commits from the currentHEAD:
$ git log -2master
because we feed "
2master" toatoi()without making sure that the whole string is parsed as an integer.Use the
strtol_i()helper function instead.