How do I see the commit differences between branches in git?

后端 未结 10 975
太阳男子
太阳男子 2020-12-04 04:13

I\'m on branch-X and have added a couple more commits on top of it. I want to see all the differences between MASTER and the branch that I am on in terms of commits. I could

10条回答
  •  忘掉有多难
    2020-12-04 04:57

    If you want to compare based on the commit messages, you can do the following:

    git fetch
    git log --oneline origin/master | cut -d' ' -f2- > master_log
    git log --oneline origin/branch-X | cut -d' ' -f2- > branchx_log
    diff <(sort master_log) <(sort branchx_log)
    

提交回复
热议问题