views:

21

answers:

1

I have two git repositories, like this:

  • proj1
  • proj2

proj1 has a tag v1.0.0 and proj2 has tags v2.0.0 and v2.1.0. Now I would like to merge proj1 (the v1.0.0 tag in particular) into proj2 as if it was an earlier version of proj2, so that I have the tags v1.0.0, v2.0.0 and v2.1.0. I'm also fine if I have to merge proj2 into proj1 or merge both into a new repository, as long as I get all the tags and the combined history.

There is a lot of people asking similar questions, like the following, but none seem to have my particular problem - adding two repositories as different versions. http://stackoverflow.com/questions/2233933/merging-two-git-repositories

Is that possible?

+3  A: 

It is possible. Use git remote add proj2 file:///path/to/proj2 within proj1. Then git fetch proj2. Now all the commits in proj2 are visible within proj1, and you can use branch merging, tagging, etc. to splice things together in one repository.

If this is a repository used by other people you might want to backup your .git directory before starting.

Spike Gronim
Thanks for the hint. I copied the repository holding versions v2.0.0 and v2.1.0, fetched from my old one and voila: The tag v1.0.0 was incorporated just fine. Nothing else I had to do.
eomer