git - merge conflict when local is deleted but file exists in remote

前端 未结 6 769
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 04:58

I am very new to git and wondered how I should go about a merge where in the local repo I have deleted several files on the master branch but these files exist within the re

6条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 05:37

    As an added tip in addition to the accepted answer, in a "deleted by us", if you would like to see the changes that were made to the deleted file so that you may apply those changes elsewhere you can use:

    git diff ...origin/master -- path/to/file
    

    If it is a "deleted by them" scenario, and you would like to see the changes so you can apply them elsewhere, you can use:

    git diff origin/master... -- path/to/file
    

提交回复
热议问题