Using Git, show all commits that exist *only* on one specific branch, and not *any* others

后端 未结 8 1504
小蘑菇
小蘑菇 2020-12-07 08:17

Given a branch, I\'d like to see a list of commits that exist only on that branch. In this question we discuss ways to see which commits are on one branch

8条回答
  •  盖世英雄少女心
    2020-12-07 08:54

    We just found this elegant solution

    git log --first-parent --no-merges
    

    In your example of course the initial commit still shows up.

    this answer does not exactly answer the question, because the initial commit still shows up. On the other hand many people coming here seem to find the answer they are looking for.

提交回复
热议问题