How can I see what branch another branch was forked from?

前端 未结 4 624
甜味超标
甜味超标 2020-12-05 02:23

My git repository has three branches, devel, stable and customers/acme_patches. A long time ago, stable was forked from <

4条回答
  •  半阙折子戏
    2020-12-05 03:21

    well, git merge-base customers/acme_patches stable should show the common ancestor of those two branches.

    You could try, for instance, gitk --left-right customers/acme_patches...stable (note three dots!). This will show all the commits that are in those branches and not in the merge base. Using --left-right will mark each commit with a left or right arrow according to which branch they are in- a left arrow if they are in customers/acme_patches and a right arrow if they are in stable.

    Possibly also add --date-order which I've found sometimes helps make sense of the output.

    (You can use this syntax with git log --graph rather than gitk but imho this is a case where the visual graph display is a big improvement).

提交回复
热议问题