git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How to combine git repos with similar code and keep all branches and tags?

From
JLJose de Leon <jdeleon@ensim.com>
Date
Apr 14, 2015, 16:44 UTC
Message-ID
<BBAA9EAE77388248BCAB045DA762C5A83EFE242F@EXBE01-ENSIM.ms.ensim.com>
Hi All,
I've got an interesting problem and the possible solutions I've found from searching google don't seem to work for us.  In a nutshell, I need to combine multiple git repositories into single repository and preserve all history, branches and tags from each repository.    
Does anybody have a solution for this, how do this kind of thing, is it even possible?
For some unknown reason to me, our developers started a git project, called Ver1, this was the first version.  Then sometime later, they created a new git repository called Ver2, the initial commit for Ver2 was essentially a copy of the code in Ver1 from the master.  They didn't clone it, they just copied the code at the latest point.  This wasn't done by forking.  Then they repeated this for Ver3 and Ver4, etc.  On top of all that, they have been adding new code to Ver1, Ver2, etc. that has caused each to divert from the other and each have their own branch and tag sets.  They have similar directory structure and similar file names, but there are some slight differences in structure.
Well, this has become unmanageable and now we want to combine them into one single git repository.   
Logically, these are the same project but at different versions, basically, Ver1 and Ver2, etc, should be simply branches at different times if these were combined into a single repository.
Next: Matthieu Moy
Message 1 of 5 in “How to combine git repos with similar code and keep all branches and tags?”
  1. Jose de LeonApr 14, 2015
  2. Matthieu MoyApr 14, 2015
  3. Junio C HamanoApr 14, 2015
  4. Max HornApr 14, 2015
  5. Jose de LeonApr 14, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.