Reputation: 2144
I've two branches, master and live. Master is the development branch and contains commits that aren't ready to go into live.
What I want to be able to do is view all the commits that are in master than aren't in live, I've had a good search on here and Google and I was using this:
git log --cherry-pick --no-merges --oneline master...live
This worked until I merged live into master. But now it lists several commits that are in both.
So what is the correct command to view all commits that are in the master branch and not in the live branch?
Upvotes: 27
Views: 7111
Reputation: 2144
I ended up solving my own problem using a short python script combining git patch-id and git log, the script can be found here https://gist.github.com/4565584
Upvotes: 2
Reputation: 70853
You are very close. The correct command is:
git log --cherry-pick --oneline --no-merges --left-only master...live
from the log manpage:
--left-only, --right-only
List only commits on the respective side of a symmetric range, i.e. only those which would be marked < resp. > by --left-right.
For example, --cherry-pick --right-only A...B omits those commits from B which are in A or are patch-equivalent to a commit in A. In other words, this lists the + commits from git cherry A B. More precisely, --cherry-pick --right-only --no-merges gives the exact list.
Upvotes: 27