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

前端 未结 2 961
心在旅途
心在旅途 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:02

    try this

    git pull
    

    go to folder to delete project and project_v1, rename projectBeta to project.

    git add --all
    git commit 
    git push
    

    and you do the same for other branch

    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题