I have two different local git repos. Each is hosted on github as (separate) private repos, with its own set of collaborators / developers. I am the owner of those two github repos.
# Repo A, which is in
~/projects/repo-a
# Repo B, which is in
~/projects/repo-b
I have two questions: * How do I merge repo-a to repo-b, and vice versa. Is it possible? * If it's possible, can we make repo-a collaborators do not show up on repo-b, and vice versa? The idea is to keep the confidentiality of the repo collaborators.
Thanks.
Submodules are not the best for frequent commits. In my project I use git-slave, which is a little out of date, but suits all my needs :)
Check out "How do you merge two git repositories?". In short: Learn about "submodules" and "subtree merging".
My suggestion: read the git book:
$ git remote add repo-a <url a>
$ git remote add repo-b <url b>
$ git fetch repo-a
$ git fetch repo-b
$ git checkout repo-a/master
$ git checkout -b merging-branch
$ git merge repo-b/master
来源:https://stackoverflow.com/questions/11199602/merge-2-different-git-repos