git log to return only the commits made to the master branch?

后端 未结 2 1588
故里飘歌
故里飘歌 2020-12-30 19:15

I\'ve done a bit of searching and found:

git log myBranchName

as a possible solution. But what happens when my branch is the master branch?

2条回答
  •  一整个雨季
    2020-12-30 20:10

    I think this is what you want

    git log --first-parent master
    

    To quote the manual

    Follow only the first parent commit upon seeing a merge commit. This option can give a better overview when viewing the evolution of a particular topic branch, because merges into a topic branch tend to be only about adjusting to updated upstream from time to time, and this option allows you to ignore the individual commits brought in to your history by such a merge.

提交回复
热议问题