{"thread":{"id":"13668","subject":"how to union 2 repos","startedAt":"2008-05-26T10:08:24Z","lastAt":"2008-05-26T11:10:42Z","messageCount":2,"participants":["Jamil Djadala","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"77759","messageId":"1211796504.20622.26.camel@bee.datamax.bg","threadId":"13668","inReplyTo":null,"subject":"how to union 2 repos","fromName":"Jamil Djadala","fromEmail":"djadala@datamax.bg","sentAt":"2008-05-26T10:08:24Z","receivedAt":"2008-05-26T10:08:24Z","isPatch":false,"sender":{"key":"djadala@datamax.bg","avatar":null},"body":"Hi all\n\nquote from core-tutorial:\n######### begin quote\nNote\nYou could do without using any branches at all, by keeping as many local\nrepositories as you would like to have branches, and merging between\nthem with git pull, just like you merge between branches. The advantage\nof this approach is that it lets you keep a set of files for each branch\nchecked out and you may find it easier to switch back and forth if you\njuggle multiple lines of development simultaneously. Of course, you will\npay the price of more disk usage to hold multiple working trees, but\ndisk space is cheap these days.\n########## end quote\n\n\nI still can't realize how to  union 2 git repositories with linear\nhistory, into 1 repo with 2 branches.\ni try git-rebase, but results are unexpected.\n\ni have 2 repos with history, assuming initial commit in both repos are\nsame:\n\n1:\na-b-c-d-e-f\n2:\na-B-C-D-E-F\n\n\ni want repository with this history:\n\na-b-c-d-e-f\n \\B-C-D-E-F\n\n\ni try following:\n1. copy objects from other repo :\ngit-fetch ../other/.git +master:otherMaster\nhistory after this command is 2 unconnected chains:\na-b-c-d-e-f  a-B-C-D-E-F\n2.Then i try following:\ngit-rebase --onto a f F\n\nbut results are strange\n(git, complain about merge errors, history is like:\n\nx-x-x-x-x-x-----------x\n \\x-x-x    \\x-x-x-x-x\n\n)\n\n﻿can someone help me how to do this ?\n\n\n\nThanks in advance\n\n-- \nJamil Djadala <djadala@datamax.bg>\nDatamax\n"},{"id":"77763","messageId":"483A9AB2.706@viscovery.net","threadId":"13668","inReplyTo":"1211796504.20622.26.camel@bee.datamax.bg","subject":"Re: how to union 2 repos","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-05-26T11:10:42Z","receivedAt":"2008-05-26T11:10:42Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Jamil Djadala schrieb:\n> i have 2 repos with history, assuming initial commit in both repos are\n> same:\n> \n> 1:\n> a-b-c-d-e-f\n> 2:\n> a-B-C-D-E-F\n> \n> \n> i want repository with this history:\n> \n> a-b-c-d-e-f\n>  \\B-C-D-E-F\n\n$ git fetch ../other master:otherMaster\n$ echo $B $a > .git/info/grafts\n$ git filter-branch -- --all\n\nThe man page of git-filter-branch mentions the grafts trick.\n\n-- Hannes\n"}]}