How to compare two git branches and filter the differences by commit message?

后端 未结 3 477
陌清茗
陌清茗 2021-01-28 07:53

I have a release branch named release/X.X.X.X which contains all feature branches I want to deploy to production. The release branch is made on top of master<

3条回答
  •  天涯浪人
    2021-01-28 08:36

    The question title admits a slightly different answer, which could be useful to some people. A simple way to compare two branches by commit title only is to dump commit titles from each branch to a separate text file, and open these two files in a diff viewer:

    git --no-pager log --pretty=format:%s master > log_master.txt
    git --no-pager log --pretty=format:%s other > log_other.txt
    meld log_master.txt log_other.txt
    

    We first dump commit subjects from branch master to the file log_master.txt, then commit subjects from branch other to the file log_other.txt, and open them in the visual diff viewer meld (one alternative is kdiff3).

提交回复
热议问题