Is it possible to show if git branches have the same commits if the one of the branches has been rebased so they don't have the same SHA1 IDs? -
i'm trying same effect of running git branch --merged
allow same commits (commit message + diff) have been rebased @ point.
using git log
--cherry-mark
option work. specifically, can see set of commits same between branch a
, branch b
following:
git log --cherry-mark --oneline --graph --decorate a...b
example output:
$ git log --cherry-mark --oneline --graph --decorate master...feature = 1e4f971 (head, feature) add greetings = 926857a add greetings = bfede5b add greetings = 14099b6 (master) add hellos = a0576fa add hellos = 8822553 add hellos
in above output, see first 3 commits in output feature
equivalent first 3 commits in output master
, though sha ids , commit messages different.
from official linux kernel git documentation git log
:
--cherry-mark
like
--cherry-pick
(see below) mark equivalent commits=
rather omitting them, , inequivalent ones+
.--cherry-pick
omit commit introduces same change commit on "other side" when set of commits limited symmetric difference.
for example, if have 2 branches, , b, usual way list commits on 1 side of them
--left-right
(see example below in description of--left-right
option). shows commits cherry-picked other branch (for example, "3rd on b" may cherry-picked branch a). option, such pairs of commits excluded output.
you can learn more triple dot ...
commit range syntax @ revision selection chapter of free online pro git book.
Comments
Post a Comment