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

后端 未结 10 956
太阳男子
太阳男子 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:56

    I used some of the answers and found one that fit my case ( make sure all tasks are in the release branch).

    Other methods works as well but I found that they might add lines that I do not need, like merge commits that add no value.

    git fetch
    git log origin/master..origin/release-1.1 --oneline --no-merges
    

    or you can compare your current with master

    git fetch
    git log origin/master..HEAD --oneline --no-merges
    

    git fetch is there to make sure you are using updated info.

    In this way each commit will be on a line and you can copy/paste that into an text editor and start comparing the tasks with the commits that will be merged.

提交回复
热议问题