{"thread":{"id":"37311","subject":"Merging semi-parallel universes into one coherent repository","startedAt":"2014-08-08T01:41:29Z","lastAt":"2014-08-08T01:41:29Z","messageCount":1,"participants":["Ryan Gaffney"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"247463","messageId":"CAJH7hnOXOuz0SxLU99iXo9ikfN==HgwmxKyXx1nukodVqYUtoA@mail.gmail.com","threadId":"37311","inReplyTo":null,"subject":"Merging semi-parallel universes into one coherent repository","fromName":"Ryan Gaffney","fromEmail":"ryanmgaffney@gmail.com","sentAt":"2014-08-08T01:41:29Z","receivedAt":"2014-08-08T01:41:29Z","isPatch":false,"sender":{"key":"ryanmgaffney@gmail.com","avatar":null},"body":"Hello\n\nI created a post on SO about this; pasting it here for convenience:\n\n= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\nhttp://stackoverflow.com/questions/25193518/fixing-branches-disconnected-from-master\n\nAfter \"completing\" a repository migration, we noticed that all of our\nbranches are all behind and ahead of master by hundreds to thousands\nof commits.\n\nSome context -- originally I used git-svn to migrate the repositories\nfrom SVN to git. Later down the line I used this solution to merge\nmultiple (7) repositories into one.\n\nHowever, I also improvised on that solution for the repositories'\nbranches. The result was disconnected branches -- branches that have\nall of the commits and proper change history, but are not actually\nassociated with master in any way since the commits in the branches\nhave different SHA's from those in the new, shared master.\n\nAdditionally, the original \"branching\" in the separate repositories\nhappened at different revisions, for example project X might have\nbranched for release 1.0 at revision 30 whereas project Y might have\nbranched fro release 1.0 at revision 42... and all of them have\ndifferent times (and perhaps multiple times) where they merged back to\nmaster.\n\nIs there any clean way to fix this link to make it look like all of\nthese repositories branched together? And to fix the commits so they\nactually properly map to commits in master?\n= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\n\nI am sure there is a better way to word the above... but basically I\nhave seven used-to-be-separate repositories with the same branches\n(say r1.0 as above).  After some magic with filter-branch, they are\nall one repository -- all history in-tact.  Additionally, same-named\nbranches had their histories mashed together.  That's all peachy.\n\nWhat's *not* peachy is that each of these branches shares commits with\nmaster and doesn't know it.  Thus each branch looks \"disconnected\"\nfrom master, e.g. there is no pretty branch graph when you look\nthrough the history with \"git log --pretty=format:\"%h %s\" --graph\".\n\nDoes anybody know of a way to rectify this issue?\n\nLet me know if any clarifications are needed.  Help is much appreciated...\n\n-- Ryan\n"}]}