Git diff between current branch and master but not including unmerged master commits

前端 未结 4 1856
长情又很酷
长情又很酷 2021-01-29 20:17

I want a diff of all changes in a branch that is not merged to master yet.

I tried:

git diff master
git diff branch..master
git diff branch...master
         


        
4条回答
  •  伪装坚强ぢ
    2021-01-29 20:55

    As also noted by John Szakmeister and VasiliNovikov, the shortest command to get the full diff from master's perspective on your branch is:

    git diff master...
    

    This uses your local copy of master.

    To compare a specific file use:

    git diff master... filepath
    

    Output example:

提交回复
热议问题