Git log to get commits only for a specific branch

后端 未结 12 1704
挽巷
挽巷 2020-11-29 15:13

I want to list all commits that are only part of a specific branch.

With the following, it lists all the commits from the branch, but also from the parent (master)

12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 15:43

    From what it sounds like you should be using cherry:

    git cherry -v develop mybranch
    

    This would show all of the commits which are contained within mybranch, but NOT in develop. If you leave off the last option (mybranch), it will compare the current branch instead.

    As VonC pointed out, you are ALWAYS comparing your branch to another branch, so know your branches and then choose which one to compare to.

提交回复
热议问题