Using git to merge two directories with common parent (but different SHA1)

前端 未结 2 568
耶瑟儿~
耶瑟儿~ 2020-12-29 17:06

In our project somebody took a copy of the code. They started a new git repository in their directory and continued their work there. Meanwhile the work on our main project

2条回答
  •  孤独总比滥情好
    2020-12-29 17:33

    Assume you are now in the repo include A---B---C---D.

    You need first to add the other repo into this repo use the command.

    $git remote add another_repo 
    $git fetch another_repo
    

    Then you can merge, use

    $git merge another_repo/master
    

提交回复
热议问题