Git merge strategy to ignore deleted files

后端 未结 4 1291
悲&欢浪女
悲&欢浪女 2020-12-30 00:45

I have special branch (release branch) which is an exact copy of master branch with some files and directories removed. No development is happening on this branch, however i

4条回答
  •  死守一世寂寞
    2020-12-30 01:24

    There's probably a better way to do this, but I solved a similar problem by doing the merge (with the default merge strategy) and then running

    git status | grep 'deleted by us' | awk '{print $4}' | xargs git rm
    

    After this, you should resolve other conflicts as normal and then commit.

    This just deletes all files that had been deleted on the current branch, which I think is what you want.

提交回复
热议问题