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

Merging semi-parallel universes into one coherent repository

From
RGRyan Gaffney <ryanmgaffney@gmail.com>
Date
Aug 8, 2014, 01:41 UTC
Message-ID
<CAJH7hnOXOuz0SxLU99iXo9ikfN==HgwmxKyXx1nukodVqYUtoA@mail.gmail.com>
Hello
I created a post on SO about this; pasting it here for convenience:

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = http://stackoverflow.com/questions/25193518/fixing-branches-disconnected-from-master

After "completing" a repository migration, we noticed that all of our branches are all behind and ahead of master by hundreds to thousands of commits.

Some context -- originally I used git-svn to migrate the repositories from SVN to git. Later down the line I used this solution to merge multiple (7) repositories into one.

However, I also improvised on that solution for the repositories' branches. The result was disconnected branches -- branches that have all of the commits and proper change history, but are not actually associated with master in any way since the commits in the branches have different SHA's from those in the new, shared master.

Additionally, the original "branching" in the separate repositories happened at different revisions, for example project X might have branched for release 1.0 at revision 30 whereas project Y might have branched fro release 1.0 at revision 42... and all of them have different times (and perhaps multiple times) where they merged back to master.

Is there any clean way to fix this link to make it look like all of these repositories branched together? And to fix the commits so they actually properly map to commits in master? = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

I am sure there is a better way to word the above... but basically I have seven used-to-be-separate repositories with the same branches (say r1.0 as above). After some magic with filter-branch, they are all one repository -- all history in-tact. Additionally, same-named branches had their histories mashed together. That's all peachy.

What's *not* peachy is that each of these branches shares commits with master and doesn't know it. Thus each branch looks "disconnected" from master, e.g. there is no pretty branch graph when you look through the history with "git log --pretty=format:"%h %s" --graph".

Does anybody know of a way to rectify this issue?
Let me know if any clarifications are needed.  Help is much appreciated...
-- Ryan
Message 1 of 1 in “Merging semi-parallel universes into one coherent repository”
  1. Ryan GaffneyAug 8, 2014

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.