Git: How to list commits on this branch but not from merged branches

前端 未结 4 1217
小蘑菇
小蘑菇 2020-12-02 09:58

Suppose your git commit history looks like this:

A---B---C---D---E---F master
     \\         /
      X---Y---Z topic

Is it possible to hav

4条回答
  •  余生分开走
    2020-12-02 10:03

    git log has option --first-parent, so you won't get topic history.

    When merged from master, the master commits are the first parents in merge. Git log allows to display only those commits with --first-parent, so you get the right stuff.

提交回复
热议问题