{"thread":{"id":"16567","subject":"git-svn with multiple remote repositories?","startedAt":"2008-12-02T21:39:30Z","lastAt":"2008-12-03T08:45:02Z","messageCount":3,"participants":["Josef Wolf","Jacob Helwig","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"96986","messageId":"20081202213930.GD12716@raven.wolf.lan","threadId":"16567","inReplyTo":null,"subject":"git-svn with multiple remote repositories?","fromName":"Josef Wolf","fromEmail":"jw@raven.inka.de","sentAt":"2008-12-02T21:39:30Z","receivedAt":"2008-12-02T21:39:30Z","isPatch":false,"sender":{"key":"jw@raven.inka.de","avatar":null},"body":"Hello,\n\nI am trying to create a git repository with two remote svn repositories\nso that I can merge/move patch-sets back and forth between the svn\nrepositories.\n\nThis is what I have tried so far:\n\n  mkdir -p project\n  cd project\n  git-svn init -R private -s https://foo.bar/repos/private\n\nThen I go and edit .git/config too look like this:\n\n  [core]\n          repositoryformatversion = 0\n          filemode = true\n          bare = false\n          logallrefupdates = true\n  [svn-remote \"private\"]\n          url       =   https://foo.bar/repos/private\n          fetch     =      trunk:refs/remotes/private/trunk\n          branches  = branches/*:refs/remotes/private/*\n          tags      =     tags/*:refs/remotes/private/tags/*\n  [svn-remote \"public\"]\n          url       =   https://foo.bar/repos/public\n          fetch     =      trunk:refs/remotes/public/trunk\n          branches  = branches/*:refs/remotes/public/*\n          tags      =     tags/*:refs/remotes/public/tags/*\n\nAnd finally, I do\n\n  git-svn fetch -R private\n  git-svn fetch -R public\n\nBoth commands seem to fetch the contents from their origins.  But\ngit-branch shows me only the local master branch with contents from\nthe \"private\" svn repository.  When I do\n\n  git checkout public/trunk\n\nthe contents actually change to reflect the \"public\" svn repository,\nbut git-branch says I am on \"(no branch)\" at all.\n\nAs a newbie to git, I am somewhat confused now.  Any hints how I can\nget a hold on the remote branches merge between them?\n"},{"id":"96993","messageId":"9071816B-9AA4-4891-8719-556446C16AD7@gmail.com","threadId":"16567","inReplyTo":"20081202213930.GD12716@raven.wolf.lan","subject":"Re: git-svn with multiple remote repositories?","fromName":"Jacob Helwig","fromEmail":"jacob.helwig@gmail.com","sentAt":"2008-12-02T23:07:43Z","receivedAt":"2008-12-02T23:07:43Z","isPatch":false,"sender":{"key":"jacob.helwig@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14557?v=4"},"body":"No branch for your checkout is correct. Try something like: git  \ncheckout -b foo public/trunk\n\nOn Dec 2, 2008, at 13:39, Josef Wolf <jw@raven.inka.de> wrote:\n\n> Hello,\n>\n> I am trying to create a git repository with two remote svn  \n> repositories\n> so that I can merge/move patch-sets back and forth between the svn\n> repositories.\n>\n> This is what I have tried so far:\n>\n>  mkdir -p project\n>  cd project\n>  git-svn init -R private -s https://foo.bar/repos/private\n>\n> Then I go and edit .git/config too look like this:\n>\n>  [core]\n>          repositoryformatversion = 0\n>          filemode = true\n>          bare = false\n>          logallrefupdates = true\n>  [svn-remote \"private\"]\n>          url       =   https://foo.bar/repos/private\n>          fetch     =      trunk:refs/remotes/private/trunk\n>          branches  = branches/*:refs/remotes/private/*\n>          tags      =     tags/*:refs/remotes/private/tags/*\n>  [svn-remote \"public\"]\n>          url       =   https://foo.bar/repos/public\n>          fetch     =      trunk:refs/remotes/public/trunk\n>          branches  = branches/*:refs/remotes/public/*\n>          tags      =     tags/*:refs/remotes/public/tags/*\n>\n> And finally, I do\n>\n>  git-svn fetch -R private\n>  git-svn fetch -R public\n>\n> Both commands seem to fetch the contents from their origins.  But\n> git-branch shows me only the local master branch with contents from\n> the \"private\" svn repository.  When I do\n>\n>  git checkout public/trunk\n>\n> the contents actually change to reflect the \"public\" svn repository,\n> but git-branch says I am on \"(no branch)\" at all.\n>\n> As a newbie to git, I am somewhat confused now.  Any hints how I can\n> get a hold on the remote branches merge between them?\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"97037","messageId":"4936470E.6090500@drmicha.warpmail.net","threadId":"16567","inReplyTo":"20081202213930.GD12716@raven.wolf.lan","subject":"Re: git-svn with multiple remote repositories?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2008-12-03T08:45:02Z","receivedAt":"2008-12-03T08:45:02Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Josef Wolf venit, vidit, dixit 02.12.2008 22:39:\n> Hello,\n> \n> I am trying to create a git repository with two remote svn repositories\n> so that I can merge/move patch-sets back and forth between the svn\n> repositories.\n> \n> This is what I have tried so far:\n> \n>   mkdir -p project\n>   cd project\n>   git-svn init -R private -s https://foo.bar/repos/private\n> \n> Then I go and edit .git/config too look like this:\n> \n>   [core]\n>           repositoryformatversion = 0\n>           filemode = true\n>           bare = false\n>           logallrefupdates = true\n>   [svn-remote \"private\"]\n>           url       =   https://foo.bar/repos/private\n>           fetch     =      trunk:refs/remotes/private/trunk\n>           branches  = branches/*:refs/remotes/private/*\n>           tags      =     tags/*:refs/remotes/private/tags/*\n>   [svn-remote \"public\"]\n>           url       =   https://foo.bar/repos/public\n>           fetch     =      trunk:refs/remotes/public/trunk\n>           branches  = branches/*:refs/remotes/public/*\n>           tags      =     tags/*:refs/remotes/public/tags/*\n> \n> And finally, I do\n> \n>   git-svn fetch -R private\n>   git-svn fetch -R public\n> \n> Both commands seem to fetch the contents from their origins.  But\n> git-branch shows me only the local master branch with contents from\n> the \"private\" svn repository.  When I do\n> \n>   git checkout public/trunk\n> \n> the contents actually change to reflect the \"public\" svn repository,\n> but git-branch says I am on \"(no branch)\" at all.\n\nYou want \"git branch -a\" if you want to see all branches including\nremotes. \"master\" happens to reflect \"remotes/private/trunk\" because the\nfirst fetch set it up like that. Further fetches will not change master.\n\nRemote branches are your local copy, but different from local branches:\nyou're not supposed to check them out, and if you do anyways, you get a\n\"detached HEAD\". Well, your repo gets a detached HEAD...\n\nIf you want to work with remote branches, create a tracking branch: a\nlocal branch that is based on a remote one and that is set up to rebase\n(or merge) new commits from the remote:\n\ngit checkout -b mypublic/trunk remotes/public/trunk\n\nYou can name the local branch any way you want, even \"public/trunk\", but\nthat may lead to confusion when you look at the output of \"git branch\n-a\" which suppresses the \"remote/\" part.\n\nMichael\n"}]}