{"thread":{"id":"23692","subject":"I've been pushing to one branch from both git-svn and git","startedAt":"2010-05-04T11:43:23Z","lastAt":"2010-05-05T09:09:58Z","messageCount":3,"participants":["Ricky Clarkson","Avery Pennarun"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"140903","messageId":"z2h7eeb06461005040443ib2fb7405i39e7d5b4220bfb08@mail.gmail.com","threadId":"23692","inReplyTo":null,"subject":"I've been pushing to one branch from both git-svn and git","fromName":"Ricky Clarkson","fromEmail":"ricky.clarkson@gmail.com","sentAt":"2010-05-04T11:43:23Z","receivedAt":"2010-05-04T11:43:23Z","isPatch":false,"sender":{"key":"ricky.clarkson@gmail.com","avatar":null},"body":"Hi,\n\nI have a git repository we'll call the git svn repo, in which I only\nperform git svn fetch and git push bare.\n\nbare is a bare git repository, which I push to from a local\nrepository.  The mistake I've been making is to push to the branch\n'trunk' in bare, from my local repository.  The reason this is a\nmistake is because git push bare from the git svn repo also pushes to\nthere.\n\nToday I've been forced to learn of my mistake, as I cannot push from\nthe git svn repo without possibly losing commits.  It turns out (which\nis probably obvious to you all) that I should have been pushing to,\nsay, bare's 'master' branch instead of its trunk one.\n\nI don't intend to push back to svn from any of these repos, but I\nwould like to be able to continue pulling changes from svn at least\nfor the time being.  What should I do?\n\nThanks,\nRicky.\n\n--\nRicky Clarkson\nJava and Scala Programmer, AD Holdings\n+44 1928 706373\nSkype: ricky_clarkson\nGoogle Talk: ricky.clarkson@gmail.com\nGoogle Wave: ricky.clarkson@googlewave.com\n"},{"id":"140917","messageId":"w2s32541b131005040934o339e3e79vf386427ed282ce64@mail.gmail.com","threadId":"23692","inReplyTo":"z2h7eeb06461005040443ib2fb7405i39e7d5b4220bfb08@mail.gmail.com","subject":"Re: I've been pushing to one branch from both git-svn and git","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-05-04T16:34:31Z","receivedAt":"2010-05-04T16:34:31Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Tue, May 4, 2010 at 7:43 AM, Ricky Clarkson <ricky.clarkson@gmail.com> wrote:\n> I have a git repository we'll call the git svn repo, in which I only\n> perform git svn fetch and git push bare.\n>\n> bare is a bare git repository, which I push to from a local\n> repository.  The mistake I've been making is to push to the branch\n> 'trunk' in bare, from my local repository.  The reason this is a\n> mistake is because git push bare from the git svn repo also pushes to\n> there.\n>\n> Today I've been forced to learn of my mistake, as I cannot push from\n> the git svn repo without possibly losing commits.  It turns out (which\n> is probably obvious to you all) that I should have been pushing to,\n> say, bare's 'master' branch instead of its trunk one.\n>\n> I don't intend to push back to svn from any of these repos, but I\n> would like to be able to continue pulling changes from svn at least\n> for the time being.  What should I do?\n\nIf you don't intend to push back to svn, then life is relatively simple.\n\nFirst, on your PC where you've been making other commits, rename the\ntrunk branch to master and push that:\n\n   git branch -m trunk master\n   git push bare master\n\nThen delete the 'trunk' branch on bare, and re-push it from the git svn repo:\n\n   git push bare :trunk\n   git push bare trunk\n\nAnd probably you'll go back to your PC and merge the latest trunk into\nyour master:\n\n   git pull bare trunk\n     # resolve any conflicts\n   git push bare master\n\nHave fun,\n\nAvery\n"},{"id":"140974","messageId":"m2q7eeb06461005050209jee92b415v68d8918f13d3a406@mail.gmail.com","threadId":"23692","inReplyTo":"w2s32541b131005040934o339e3e79vf386427ed282ce64@mail.gmail.com","subject":"Re: I've been pushing to one branch from both git-svn and git","fromName":"Ricky Clarkson","fromEmail":"ricky.clarkson@gmail.com","sentAt":"2010-05-05T09:09:58Z","receivedAt":"2010-05-05T09:09:58Z","isPatch":false,"sender":{"key":"ricky.clarkson@gmail.com","avatar":null},"body":"Hi Avery,\n\nThanks.  I solved it a slightly different but hopefully equivalent way:\n\nCreate a new branch named master locally, and merge the changes from\ntrunk into it (I don't think any merge was needed as it would be a\ncopy of trunk).  Push master.  From the git svn repo, git push -f\norigin, then git pull in the local repo and git merge trunk (the\ncurrent branch is master).\n\nRicky.\n\n--\nRicky Clarkson\nJava and Scala Programmer, AD Holdings\n+44 1928 706373\nSkype: ricky_clarkson\nGoogle Talk: ricky.clarkson@gmail.com\nGoogle Wave: ricky.clarkson@googlewave.com\n\n\n\nOn 4 May 2010 17:34, Avery Pennarun <apenwarr@gmail.com> wrote:\n> On Tue, May 4, 2010 at 7:43 AM, Ricky Clarkson <ricky.clarkson@gmail.com> wrote:\n>> I have a git repository we'll call the git svn repo, in which I only\n>> perform git svn fetch and git push bare.\n>>\n>> bare is a bare git repository, which I push to from a local\n>> repository.  The mistake I've been making is to push to the branch\n>> 'trunk' in bare, from my local repository.  The reason this is a\n>> mistake is because git push bare from the git svn repo also pushes to\n>> there.\n>>\n>> Today I've been forced to learn of my mistake, as I cannot push from\n>> the git svn repo without possibly losing commits.  It turns out (which\n>> is probably obvious to you all) that I should have been pushing to,\n>> say, bare's 'master' branch instead of its trunk one.\n>>\n>> I don't intend to push back to svn from any of these repos, but I\n>> would like to be able to continue pulling changes from svn at least\n>> for the time being.  What should I do?\n>\n> If you don't intend to push back to svn, then life is relatively simple.\n>\n> First, on your PC where you've been making other commits, rename the\n> trunk branch to master and push that:\n>\n>   git branch -m trunk master\n>   git push bare master\n>\n> Then delete the 'trunk' branch on bare, and re-push it from the git svn repo:\n>\n>   git push bare :trunk\n>   git push bare trunk\n>\n> And probably you'll go back to your PC and merge the latest trunk into\n> your master:\n>\n>   git pull bare trunk\n>     # resolve any conflicts\n>   git push bare master\n>\n> Have fun,\n>\n> Avery\n>\n"}]}