tags:

views:

34

answers:

1

I have two separate git repositories for the same version of a single website.

domain.com-1.0
domain.com-2.0

Version 2.0 was completely redone from the ground up. There is no bridge between the two repositories. I would now like to merge the two into a single repository, but maintain the separation.

I have already tagged domain.com-1.0 in it's repo and now want to clean the working tree and move domain-2.0 and all it's commit history into 1.0's repo. Is this possible or is there a better way of accomplishing this?

Note: domain.com-1.0 will not be developed on anymore and is "being retired".

+1  A: 

I would solve this as follows:

  1. git remote add the foo-2.0 to the foo-1.0 repo

  2. git fetch the stuff from foo-2.0 to the foo-1.0 repo

  3. Fire up gitk --all to see the branches and do some proper branch (re)naming.

This should work for simple one-off cases. If you need to do this twice a day, you should think up a way to automate step 3.

ndim
Why would I need to merge any branches? The two repos are completely separate and I'm just going to keep 2.0 in a tag for reference purposes only.
PHLAK
Merge branches? You do not merge any branches. However, foo-1.0's master branch is there, and then there will be foo-2.0's remote2/master branch. You will want a local branch for remote2/master... so you will need to give that a new name, or call the old master something else and use master as the name for foo-2.0's master... however you want to name that.
ndim