Git pulling changes between two local repositories

后端 未结 2 1765
一个人的身影
一个人的身影 2020-12-13 01:49

I have two clones of same remote repository. I have made some changes to one local repository, how can I pull these changes to the other local repository without pushing it

2条回答
  •  执笔经年
    2020-12-13 02:45

    You can treat the second clone the same way you treat a remote respository on another system. You can perform all of the same operations, e.g.

    ~/repo1 $ git remote add repo2 ~/repo2
    ~/repo1 $ git fetch repo2
    ~/repo1 $ git merge repo2/foo
    

提交回复
热议问题