{"thread":{"id":"17384","subject":"connecting existing local git repository to svn","startedAt":"2009-01-27T04:10:15Z","lastAt":"2009-01-28T05:26:27Z","messageCount":7,"participants":["Ittay Dror","Michael J Gruber","Sverre Rabbelier"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"102077","messageId":"497E8927.1060506@gmail.com","threadId":"17384","inReplyTo":null,"subject":"connecting existing local git repository to svn","fromName":"Ittay Dror","fromEmail":"ittay.dror@gmail.com","sentAt":"2009-01-27T04:10:15Z","receivedAt":"2009-01-27T04:10:15Z","isPatch":false,"sender":{"key":"ittay.dror@gmail.com","avatar":"https://gravatar.com/avatar/0dc47ece3354a295768075bb5afa328d49cda722c9f3100029ada80ee4561e22?d=mp&s=160"},"body":"Hi,\n\n\nI'd like to create a branch in a subversion repository so that I can\nwork with git-svn on it.\n\n\nMy git repository is already with a history, that I don't want to\nreplicate to subversion, I want to start with subversion having just the\nlatest revision and then continue from there normally (git svn\ndcommit/rebase).\n\n\nHow can I do that?\n\n\nThanks,\n\nIttay\n"},{"id":"102103","messageId":"497EE386.5050805@drmicha.warpmail.net","threadId":"17384","inReplyTo":"497E8927.1060506@gmail.com","subject":"Re: connecting existing local git repository to svn","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-01-27T10:35:50Z","receivedAt":"2009-01-27T10:35:50Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Ittay Dror venit, vidit, dixit 01/27/09 05:10:\n> Hi,\n> \n> \n> I'd like to create a branch in a subversion repository so that I can\n> work with git-svn on it.\n> \n> \n> My git repository is already with a history, that I don't want to\n> replicate to subversion, I want to start with subversion having just the\n> latest revision and then continue from there normally (git svn\n> dcommit/rebase).\n> \n> \n> How can I do that?\n\nCreate the svn branch (with svn) and \"git svn clone\". Pull in your git\nbranch under a new name (if that is what you want).\nNow, you can e.g. \"git merge -s theirs\" your other git branch into\nmaster, git svn rebase and dcommit. Untested, but comes with best wishes ;)\n\nDo you want to discard your existing git history completely?\n\nCheers,\nMichael\n"},{"id":"102104","messageId":"497EE4E8.8070705@gmail.com","threadId":"17384","inReplyTo":"497EE386.5050805@drmicha.warpmail.net","subject":"Re: connecting existing local git repository to svn","fromName":"Ittay Dror","fromEmail":"ittay.dror@gmail.com","sentAt":"2009-01-27T10:41:44Z","receivedAt":"2009-01-27T10:41:44Z","isPatch":false,"sender":{"key":"ittay.dror@gmail.com","avatar":"https://gravatar.com/avatar/0dc47ece3354a295768075bb5afa328d49cda722c9f3100029ada80ee4561e22?d=mp&s=160"},"body":"\n\nMichael J Gruber wrote:\n\n> Ittay Dror venit, vidit, dixit 01/27/09 05:10:\n>   \n>> Hi,\n>>\n>>\n>> I'd like to create a branch in a subversion repository so that I can\n>> work with git-svn on it.\n>>\n>>\n>> My git repository is already with a history, that I don't want to\n>> replicate to subversion, I want to start with subversion having just the\n>> latest revision and then continue from there normally (git svn\n>> dcommit/rebase).\n>>\n>>\n>> How can I do that?\n>>     \n>\n> Create the svn branch (with svn) and \"git svn clone\". Pull in your git\n> branch under a new name (if that is what you want).\n> Now, you can e.g. \"git merge -s theirs\" your other git branch into\n> master, git svn rebase and dcommit. Untested, but comes with best wishes ;)\n>   \nbut wouldn't that create a revision in svn for each commit in git?\n\nwhat i want is something like:\n\ngit: ----v1----v2----v3--v4---v5\nsvn:                     \\---v4--v5\n\nso the svn history starts from v3, but the git history remains unchanged.\n\nittay\n> Do you want to discard your existing git history completely?\n>\n> Cheers,\n> Michael\n>   \n"},{"id":"102110","messageId":"bd6139dc0901270416u22b60fefp472935470b1db929@mail.gmail.com","threadId":"17384","inReplyTo":"497EE4E8.8070705@gmail.com","subject":"Re: connecting existing local git repository to svn","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-01-27T12:16:33Z","receivedAt":"2009-01-27T12:16:33Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"On Tue, Jan 27, 2009 at 11:41, Ittay Dror <ittay.dror@gmail.com> wrote:\n> git: ----v1----v2----v3--v4---v5\n> svn:                     \\---v4--v5\n>\n> so the svn history starts from v3, but the git history remains unchanged.\n\nCreate the new branch from v3 then, and use git svn to pull it in.\nThen you can do 'git rebase that-svn-branch' on your git branch to put\nall commits (not as one big commit) on top of that branch point. Now\nyou 'git checkout' that-svn-branch and do 'git reset --hard\nthe-git-branch', which should now consist of\nv1--v2--v3--v4(git)--v5(git), etc. If you do 'git svn dcommit' from\nthe that-svn-branch now it should dcommit to svn each of your git\ncommits individually. Of course, don't forget to make a backup before\nyou start messing around :P.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"102113","messageId":"497F0280.2070400@gmail.com","threadId":"17384","inReplyTo":"bd6139dc0901270416u22b60fefp472935470b1db929@mail.gmail.com","subject":"Re: connecting existing local git repository to svn","fromName":"Ittay Dror","fromEmail":"ittay.dror@gmail.com","sentAt":"2009-01-27T12:48:00Z","receivedAt":"2009-01-27T12:48:00Z","isPatch":false,"sender":{"key":"ittay.dror@gmail.com","avatar":"https://gravatar.com/avatar/0dc47ece3354a295768075bb5afa328d49cda722c9f3100029ada80ee4561e22?d=mp&s=160"},"body":"\n\nSverre Rabbelier wrote:\n\n> On Tue, Jan 27, 2009 at 11:41, Ittay Dror <ittay.dror@gmail.com> wrote:\n>   \n>> git: ----v1----v2----v3--v4---v5\n>> svn:                     \\---v4--v5\n>>\n>> so the svn history starts from v3, but the git history remains unchanged.\n>>     \n>\n> Create the new branch from v3 then, and use git svn to pull it in.\n> Then you can do 'git rebase that-svn-branch' on your git branch to put\n> all commits (not as one big commit) on top of that branch point. Now\n> you 'git checkout' that-svn-branch and do 'git reset --hard\n> the-git-branch', which should now consist of\n> v1--v2--v3--v4(git)--v5(git), etc. If you do 'git svn dcommit' from\n> the that-svn-branch now it should dcommit to svn each of your git\n>   \nsorry, my ascii art was confusing:\n\ngit: ----v1----v2----v3--v4---v5\nsvn: v1-4---v5\n\nv1-4 is v1 to v4 squashed together. (e.g., if i added a file in v2 and \nremoved in v3 it will not appear in svn history)\n\nhope it is clear now.\n\nittay\n> commits individually. Of course, don't forget to make a backup before\n> you start messing around :P.\n>\n>   \n"},{"id":"102114","messageId":"497F05D7.3060607@drmicha.warpmail.net","threadId":"17384","inReplyTo":"497F0280.2070400@gmail.com","subject":"Re: connecting existing local git repository to svn","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-01-27T13:02:15Z","receivedAt":"2009-01-27T13:02:15Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Ittay Dror venit, vidit, dixit 01/27/09 13:48:\n> \n> Sverre Rabbelier wrote:\n> \n>> On Tue, Jan 27, 2009 at 11:41, Ittay Dror <ittay.dror@gmail.com> wrote:\n>>   \n>>> git: ----v1----v2----v3--v4---v5\n>>> svn:                     \\---v4--v5\n>>>\n>>> so the svn history starts from v3, but the git history remains unchanged.\n>>>     \n>> Create the new branch from v3 then, and use git svn to pull it in.\n>> Then you can do 'git rebase that-svn-branch' on your git branch to put\n>> all commits (not as one big commit) on top of that branch point. Now\n>> you 'git checkout' that-svn-branch and do 'git reset --hard\n>> the-git-branch', which should now consist of\n>> v1--v2--v3--v4(git)--v5(git), etc. If you do 'git svn dcommit' from\n>> the that-svn-branch now it should dcommit to svn each of your git\n>>   \n> sorry, my ascii art was confusing:\n> \n> git: ----v1----v2----v3--v4---v5\n> svn: v1-4---v5\n> \n> v1-4 is v1 to v4 squashed together. (e.g., if i added a file in v2 and \n> removed in v3 it will not appear in svn history)\n\nWell, for git and svn \"revisions\" are really \"versions\" of the complete\ntree, not changesets. Have messed around with hg lately? ;)\n\nOn the other hand, a commit that introduces a new version is the\ndifference with respect to the previous \"version\".\n\nUsusally it's clear what is meant, but you seem to mix both notions.\n\nSo, if v? denotes a version, then v4 is the result of all commits\nleading up to v4. It *is* v4. \"squashing\" applies only to commits\n(\"changes\").\n\nIn any case, Sverre's as well as my suggestions should do what you want.\nWhy not try it out if you doubt it?\n\nCheers,\nMichael\n"},{"id":"102253","messageId":"497FEC83.20907@gmail.com","threadId":"17384","inReplyTo":"497F05D7.3060607@drmicha.warpmail.net","subject":"Re: connecting existing local git repository to svn","fromName":"Ittay Dror","fromEmail":"ittay.dror@gmail.com","sentAt":"2009-01-28T05:26:27Z","receivedAt":"2009-01-28T05:26:27Z","isPatch":false,"sender":{"key":"ittay.dror@gmail.com","avatar":"https://gravatar.com/avatar/0dc47ece3354a295768075bb5afa328d49cda722c9f3100029ada80ee4561e22?d=mp&s=160"},"body":"\n\nMichael J Gruber wrote:\n> Ittay Dror venit, vidit, dixit 01/27/09 13:48:\n>   \n>> Sverre Rabbelier wrote:\n>>\n>>     \n>>> On Tue, Jan 27, 2009 at 11:41, Ittay Dror <ittay.dror@gmail.com> wrote:\n>>>   \n>>>       \n>>>> git: ----v1----v2----v3--v4---v5\n>>>> svn:                     \\---v4--v5\n>>>>\n>>>> so the svn history starts from v3, but the git history remains unchanged.\n>>>>     \n>>>>         \n>>> Create the new branch from v3 then, and use git svn to pull it in.\n>>> Then you can do 'git rebase that-svn-branch' on your git branch to put\n>>> all commits (not as one big commit) on top of that branch point. Now\n>>> you 'git checkout' that-svn-branch and do 'git reset --hard\n>>> the-git-branch', which should now consist of\n>>> v1--v2--v3--v4(git)--v5(git), etc. If you do 'git svn dcommit' from\n>>> the that-svn-branch now it should dcommit to svn each of your git\n>>>   \n>>>       \n>> sorry, my ascii art was confusing:\n>>\n>> git: ----v1----v2----v3--v4---v5\n>> svn: v1-4---v5\n>>\n>> v1-4 is v1 to v4 squashed together. (e.g., if i added a file in v2 and \n>> removed in v3 it will not appear in svn history)\n>>     \n>\n> Well, for git and svn \"revisions\" are really \"versions\" of the complete\n> tree, not changesets. Have messed around with hg lately? ;)\n>\n> On the other hand, a commit that introduces a new version is the\n> difference with respect to the previous \"version\".\n>\n>   \nhere's a new one:\n\ninitial\ngit: --- c1 --- c2 --- c3 --- c4\n\ncreate svn:\ngit: --- c1 --- c2 --- c3 --- c4\nsvn --- c1|c2|c3|c4\n\nwhere c1|c2|c3|c4 is the squashing of all commits into one. it is the \nfirst revision in the svn repository\nc1|c2|c3|c4 === r1\n\n\ndo some work, commit, dcommit:\ngit: --- c1 --- c2 --- c3 --- c4 --- c5\nsvn --- c1|c2|c3|c4 --- r2\n\nwhere 'r2' is revision 2 of the svn repository and contains the same \nchanges as c5. that is diff(r2, r1) is the same as diff(c5, c4)\n\n\n\nso the svn history starts from how the working tree looks like when it \nis created and progresses from there. the git history is unaltered. i \nwant to keep on working on 'master' in git (and 'git log' should show \nall commits as before).\n\n\n\n> Ususally it's clear what is meant, but you seem to mix both notions.\n>\n> So, if v? denotes a version, then v4 is the result of all commits\n> leading up to v4. It *is* v4. \"squashing\" applies only to commits\n> (\"changes\").\n>\n> In any case, Sverre's as well as my suggestions should do what you want.\n> Why not try it out if you doubt it?\n>   \nwell, sverre's suggestion says it will dcommit each git commit \nindividually and i think your suggestion means i discard my git history \nin the branch i'm working on.\n\nthank you,\nittay\n> Cheers,\n> Michael\n>   \n"}]}