Using git log with the --cherry-mark option will work. In particular, you can see a set of commits that match between branch A and branch B with the following:
git log
Output Example:
$ git log --cherry-mark --oneline --graph --decorate master...feature = 1e4f971 (HEAD, feature) Add some greetings = 926857a Add some greetings = bfede5b Add some greetings = 14099b6 (master) Add some Hellos = a0576fa Add some Hellos = 8822553 Add some Hellos
In the above, you will see that the first 3 commits on the output for feature equivalent to the first 3 commits on the output for master , although sha identifiers and commit messages are different.
In the Linux Kernel Git white paper for git log :
--cherry-mark
Like --cherry-pick (see below), but mark equivalent commits with = , but not omitting them, and nonequivalent with + .
--cherry-pick
Omit any commit that introduces the same change as another commit on the โother sideโ when the set of commits is limited to a symmetric difference.
For example, if you have two branches, A and B, the usual way to list all commits on only one side is with --left-right (see the example below in the description of the --left-right option). However, it shows the fixations that were selected from another branch (for example, โ3rd on bโ can be selected from cherry from branch A). With this option, such commit pairs are excluded from the output.
You can also learn more about the syntax of the triple point trend range ... in the revision selection section of the FREE online version of Pro Git .
user456814
source share