{"thread":{"id":"16352","subject":"Help merging two repo without connection","startedAt":"2008-11-16T14:59:21Z","lastAt":"2008-11-16T15:33:54Z","messageCount":3,"participants":["Luca Siciliano Viglieri","Sverre Rabbelier","Peter Harris"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"95946","messageId":"AB681AEE-D229-4F1C-8D7B-8E60E0ED8E96@web.de","threadId":"16352","inReplyTo":null,"subject":"Help merging two repo without connection","fromName":"Luca Siciliano Viglieri","fromEmail":"lsiciliano@web.de","sentAt":"2008-11-16T14:59:21Z","receivedAt":"2008-11-16T14:59:21Z","isPatch":false,"sender":{"key":"lsiciliano@web.de","avatar":null},"body":"Hi,\ni'm trying to keep synched two repositories without always having a   \ndirect connection.\nMy situation is the following:\nI have a project on my computer with GIT repo.\nAnother developer visited me and cloned my repository connecting the  \ntwo computer (for example via  SSH).\nThan i sent him for the next days patched of my changes but when he  \ncame and we merged i got the following tree:\n\n                                                               /  \n-------------------------------------------(my patch)--(my second  \npatch)--\\\n                                                              /                                                                                                                      \\\n-- (first commit) -- (second  \ncommit \n)                                                                                                                        (merge \n) --\n                                                               \n\\                                                                                                                      /\n                                                               \\ (my  \npatch)--(my second patch)--------------------------------------------/\n\n\nI don't thinks its right to have double (or more?) commits. I would  \nhave expected something like:\n\n\n-- (first commit) -- (second commit)  -- (my patch)--(my second  \npatch)  --  (merge?) --\n\n\nThe patches were created with git-format-patch and merged with git-am.\nI know that the commits have different sha1 but how can i keep with  \npatches or something similar the two repositories exactly synched?\n\nThanks\n\nLuca Siciliano\n"},{"id":"95947","messageId":"bd6139dc0811160706l4dfad335wc4048cd3cfca80ec@mail.gmail.com","threadId":"16352","inReplyTo":"AB681AEE-D229-4F1C-8D7B-8E60E0ED8E96@web.de","subject":"Re: Help merging two repo without connection","fromName":"Sverre Rabbelier","fromEmail":"alturin@gmail.com","sentAt":"2008-11-16T15:06:55Z","receivedAt":"2008-11-16T15:06:55Z","isPatch":false,"sender":{"key":"alturin@gmail.com","avatar":null},"body":"On Sun, Nov 16, 2008 at 15:59, Luca Siciliano Viglieri\n<lsiciliano@web.de> wrote:\n> Hi,\n> i'm trying to keep synched two repositories without always having a  direct\n> connection.\n> My situation is the following:\n> I have a project on my computer with GIT repo.\n> Another developer visited me and cloned my repository connecting the two\n> computer (for example via  SSH).\n> Than i sent him for the next days patched of my changes but when he came and\n> we merged i got the following tree:\n\nI suspect 'git rebase' might help you out. When you apply the patches,\napply them to the branch they were based off (instead of to the most\nrecent master), and then rebase -that- branch (with your 'git am'-ed\npatches from your other box) onto your most recent master. That way\nyou should be able to keep  a linear history :).\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"95950","messageId":"eaa105840811160733s18be2705l60806b1bf40b1743@mail.gmail.com","threadId":"16352","inReplyTo":"AB681AEE-D229-4F1C-8D7B-8E60E0ED8E96@web.de","subject":"Re: Help merging two repo without connection","fromName":"Peter Harris","fromEmail":"git@peter.is-a-geek.org","sentAt":"2008-11-16T15:33:54Z","receivedAt":"2008-11-16T15:33:54Z","isPatch":false,"sender":{"key":"git@peter.is-a-geek.org","avatar":null},"body":"On Sun, Nov 16, 2008 at 9:59 AM, Luca Siciliano Viglieri wrote:\n> Hi,\n> i'm trying to keep synched two repositories without always having a  direct\n> connection.\n...\n> I don't thinks its right to have double (or more?) commits. I would have\n> expected something like:\n>\n>\n> -- (first commit) -- (second commit)  -- (my patch)--(my second patch)  --\n>  (merge?) --\n>\n>\n> The patches were created with git-format-patch and merged with git-am.\n> I know that the commits have different sha1 but how can i keep with patches\n> or something similar the two repositories exactly synched?\n\nIf you use \"git bundle\" instead of format-patch, you will have an\nunreadable binary blob instead of a human-readable patch, but the\nsha1s will not change (since the commiter information will be the\nsame). The remote side will \"git pull\" the bundle file instead of \"git\nam\"ing it.\n\nPeter Harris\n"}]}