git merge conflict due to renaming in two branches - how to fix & avoid in future?

前端 未结 2 957
心在旅途
心在旅途 2021-02-13 13:22

I have two local branches master and dev. Both branches contained three folders:

projectBeta
project
project_v1

I wan

2条回答
  •  迷失自我
    2021-02-13 14:23

    What you need is git mv and git rm.

    My guess is you probably rm'd the directories without letting git know. You must let git know because it keeps track of all the folders and needs to know how to deal with them correctly.

    What you should do is:

    git rm -r project
    git rm -r project_v1
    git mv projectBeta project
    

提交回复
热议问题