3

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.

moey
  • 9,619
  • 20
  • 64
  • 109
  • With regards to [how to merge 2 git repositories](http://stackoverflow.com/questions/1425892/how-do-you-merge-two-git-repositories), [it's been asked](http://stackoverflow.com/questions/277029/combining-multiple-git-repositories) a [few times before](http://stackoverflow.com/questions/2233933/merging-two-git-repositories). – David Cain Jun 26 '12 at 04:00
  • And the second part to your question could probably be done by `filter-branch`, modifying the authors on each commit message (which, would be modifying history, and not technically a merge). – David Cain Jun 26 '12 at 04:01

3 Answers3

0

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 :)

noisy
  • 5,701
  • 9
  • 47
  • 86
-1

Check out "How do you merge two git repositories?". In short: Learn about "submodules" and "subtree merging".

My suggestion: read the git book:

Community
  • 1
  • 1
easoncxz
  • 255
  • 1
  • 4
  • 12
-2
$ 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
David Cain
  • 14,232
  • 11
  • 62
  • 68
YuriAlbuquerque
  • 1,888
  • 1
  • 10
  • 19