How do you merge two Git repositories?

后端 未结 23 3252
耶瑟儿~
耶瑟儿~ 2020-11-21 05:45

Consider the following scenario:

I have developed a small experimental project A in its own Git repo. It has now matured, and I\'d like A to be part of larger projec

23条回答
  •  一生所求
    2020-11-21 06:18

    I had a similar challenge, but in my case, we had developed one version of the codebase in repo A, then cloned that into a new repo, repo B, for the new version of the product. After fixing some bugs in repo A, we needed to FI the changes into repo B. Ended up doing the following:

    1. Adding a remote to repo B that pointed to repo A (git remote add...)
    2. Pulling the current branch (we were not using master for bug fixes) (git pull remoteForRepoA bugFixBranch)
    3. Pushing merges to github

    Worked a treat :)

提交回复
热议问题