{"thread":{"id":"26656","subject":"Newbie question about setting up git repository from svn (git svn)","startedAt":"2011-03-04T15:57:21Z","lastAt":"2011-03-07T03:20:46Z","messageCount":4,"participants":["Hillel (Sabba) Markowitz","Neal Kreitzinger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"162770","messageId":"AANLkTi=UG4oq4QHhKoDOi9+4bhF1TDy4Z26ORj9Bdcwc@mail.gmail.com","threadId":"26656","inReplyTo":null,"subject":"Newbie question about setting up git repository from svn (git svn)","fromName":"Hillel (Sabba) Markowitz","fromEmail":"sabbahillel@gmail.com","sentAt":"2011-03-04T15:57:21Z","receivedAt":"2011-03-04T15:57:21Z","isPatch":false,"sender":{"key":"sabbahillel@gmail.com","avatar":"https://gravatar.com/avatar/10987b3bb904d2033ffa8b985ef66947bf70fe07de553c03347f9678886b7528?d=mp&s=160"},"body":"Please respond directly to sabbahillel@gmail.com as I do not have time\nto follow this mailing list.\n\n\nI am attempting to set up a git repository based on an svn repository.\nThe idea would be that the members of the project would be able to use\ngit exclusively with the central git repository acting as the\ncoordinator. This git server would be the only one capable of issuing\nthe git svn dcommit and git svn rebase and the members of the project\nwould not have to worry about it. Eventually, the subversion\nrepository would be transferred to git.\n\nI created a separate Ubuntu VM in order to set up the git repository.\nI used \"git svn clone -s\" to set up MyProject.git on \"gitserver\"\n\nThe command \"git branch -a\" shows\n* master\n  remotes/branch1\n  remotes/branch2\n  remotes/trunk\n\n\nI then went to my main VM and used ssh to clone the repository\n\ngit clone gitserver:/opt/git/MyProject\ncd MyProject\ngit branch -a\n* master\n  remotes/origin/HEAD -> origin/master\n  remotes/origin/master\n\nHow do I check out the trunk or appropriate branches from the remote?\nI am probably misreading the documentation. Would it be\n\ngit checkout -b branch1\n\ndoes the master on the remote (and here) actually point to the trunk by default?\nshould I checkout the branches on \"gitserver\"?\n\nI also do not see how I can get the list of branches from the remote\nlocation.without having to do an ssh into the gitserver, cd to the\nrepository directory, and use a 'branch -a' there. Is there a way to\nask for this information? I have not yet been successful in setting up\ngitosis yet because this is on an internal company intranet and I do\nnot have a valid machine name for my accounts as everything is being\ndone on VMs. Thus, my public key ends with\n\"sabbahillel@desktop-ubuntu\" rather than an actual machine name or\naddress.\n\nWould you have a pointer to a HOW-TO that discusses this.\n\nThanks for any help that you can give me.\n\n--\n       Sabba     -          סבא הלל        -     Hillel\nHillel (Sabba) Markowitz | Said the fox to the fish, \"Join me ashore\"\n SabbaHillel@gmail.com | The fish are the Jews, Torah is our water\nhttp://sabbahillel.blogspot.com\n"},{"id":"162891","messageId":"4D7441A9.7090505@gmail.com","threadId":"26656","inReplyTo":"AANLkTi=UG4oq4QHhKoDOi9+4bhF1TDy4Z26ORj9Bdcwc@mail.gmail.com","subject":"Re: Newbie question about setting up git repository from svn (git svn)","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2011-03-07T02:23:37Z","receivedAt":"2011-03-07T02:23:37Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 3/4/2011 9:57 AM, Hillel (Sabba) Markowitz wrote:\n> Please respond directly to sabbahillel@gmail.com as I do not have time\n> to follow this mailing list.\n>\nIt is standard practice on this newsgroup to reply to the sender and cc \nthe original cclist along with the newgroup.  Following this newsgroup \ncan be challenging when your schedule is busy, but you can learn alot of \nreally cool stuff by perusing it regularly.  I try to keep up daily but \nalas I am a few days behind.\n\n> I am attempting to set up a git repository based on an svn repository.\n> The idea would be that the members of the project would be able to use\n> git exclusively with the central git repository acting as the\n> coordinator. This git server would be the only one capable of issuing\n> the git svn dcommit and git svn rebase and the members of the project\n> would not have to worry about it. Eventually, the subversion\n> repository would be transferred to git.\n>\nI have no experience with git-svn (the svn part, that is), but your plan \nsounds good to me.  Read on to see my comments on the parts I do have \nexperience with...\n\n> I created a separate Ubuntu VM in order to set up the git repository.\n> I used \"git svn clone -s\" to set up MyProject.git on \"gitserver\"\n>\n> The command \"git branch -a\" shows\n> * master\n>    remotes/branch1\n>    remotes/branch2\n>    remotes/trunk\n>\n>\n> I then went to my main VM and used ssh to clone the repository\n>\n> git clone gitserver:/opt/git/MyProject\n> cd MyProject\n> git branch -a\n> * master\n>    remotes/origin/HEAD ->  origin/master\n>    remotes/origin/master\n>\n> How do I check out the trunk or appropriate branches from the remote?\n> I am probably misreading the documentation. Would it be\n>\n> git checkout -b branch1\n>\n\"git checkout -b branch1\" will create a new branch called branch1 based \non whatever your current HEAD is.  HEAD is the commit that you are \ncurrently pointing to, ie. the tip of the branch currently checkout out. \n  (see git checkout manpage.)  By \"trunk\" i take it you mean the \n\"master\" branch, e.g. \"git checkout master\".  The asterisk indicates \nabove that you are currently on master which is the \"trunk\" (assuming we \nhave the same definition of \"trunk\").  Therefore, \"git checkout -b \nbranch1\" will create a new branch called \"branch1\" that has the same \nhistory as master.  It sounds like you want to checkout \"branch1\", \n\"branch2\", and \"trunk\".  Read on...\n\n> does the master on the remote (and here) actually point to the trunk by default?\n> should I checkout the branches on \"gitserver\"?\n>\nnot being familiar with git-svn, but familiar with \"git\", I would advise \nyou to do the following:\n(1) on \"gitserver\" perform:\n(a) git branch branch1 remotes/branch1 (this will create a branch called \nbranch1 that tracks remotes/branch1)\n(b) git branch branch2 remotes/branch2\n(c) git branch trunk remotes/trunk\nNow you have the branches master, branch1, branch2, and trunk on \n\"gitserver\".\n(2) I don't know how to push from a git repo to an svn repo so I can't \ntell you if gitserver master points to svn trunk or not.  However, read \non for what I do know...\n\n> I also do not see how I can get the list of branches from the remote\n> location.without having to do an ssh into the gitserver, cd to the\n> repository directory, and use a 'branch -a' there. Is there a way to\n> ask for this information? I have not yet been successful in setting up\n> gitosis yet because this is on an internal company intranet and I do\n> not have a valid machine name for my accounts as everything is being\n> done on VMs. Thus, my public key ends with\n> \"sabbahillel@desktop-ubuntu\" rather than an actual machine name or\n> address.\n>\nThe way you get the list is by doing a git-fetch on MyProject (AFTER you \ncreate the branches on gitserver).  This will create remote tracking \nbranches for all the branches on gitserver.  Notice I said \"branches on \ngitserver\" and not \"remote tracking branches on gitserver\".  You can't \ntrack the remote tracking branches of your remote (at least not sanely). \n  Thats why you had to create tracking branches on gitserver that track \nthe remote tracking branches that track the svn repo.  Now that you have \nbranches \"branch1\", \"branch2\", and \"trunk\" on gitserver you can track \nthem in MyProject.  git-fetch will create remotes/origin/branch1, \nremotes/origin/branch2, remotes/origin/trunk in MyProject.  Now you can \ndo \"git branch branch1 remotes/origin/branch1\" to create the branch1 \nbranch in MyProject.  \"git checkout branch1\" in MyRepo will check it \nout.  Repeat for branch2 and trunk.  (I'm not familiar with ssh details, \nbut I assume your last ssh comment is made into a non-issue by what I \njust stated above.)\n\n> Would you have a pointer to a HOW-TO that discusses this.\n>\nI assume these links:\n\nhttp://git-scm.com/course/svn.html\n\nhttps://git.wiki.kernel.org/index.php/GitSvnCrashCourse\n\nhttps://git.wiki.kernel.org/index.php/GitSvnSwitch\n\nhttps://git.wiki.kernel.org/index.php/SvnMigration\n\nhttp://utsl.gen.nz/talks/git-svn/intro.html\n\nhttp://www.tfnico.com/presentations/git-and-subversion\n\nor the git-svn manpage:\n\nhttp://www.kernel.org/pub/software/scm/git/docs/v1.7.1.4/git-svn.html\n\nwill help you. (you need to use the git version of the manual that \ncorresponds to your installation.  1.7.1.4 is relevant to me, but \nperhaps not to you.)\n\n> Thanks for any help that you can give me.\n>\n> --\n>         Sabba     -          סבא הלל        -     Hillel\n> Hillel (Sabba) Markowitz | Said the fox to the fish, \"Join me ashore\"\n>   SabbaHillel@gmail.com | The fish are the Jews, Torah is our water\n> http://sabbahillel.blogspot.com\n\nDespite my ignorance regarding svn and git-svn, I hope my comments will \nbe of some help to you or point you in the right direction.\n\nv/r,\nNeal\n"},{"id":"162892","messageId":"4D74441C.6000607@gmail.com","threadId":"26656","inReplyTo":"4D7441A9.7090505@gmail.com","subject":"Re: Newbie question about setting up git repository from svn (git svn)","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2011-03-07T02:34:04Z","receivedAt":"2011-03-07T02:34:04Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 3/6/2011 8:23 PM, Neal Kreitzinger wrote:\n> On 3/4/2011 9:57 AM, Hillel (Sabba) Markowitz wrote:\n>> Please respond directly to sabbahillel@gmail.com as I do not have time\n>> to follow this mailing list.\n>>\n> It is standard practice on this newsgroup to reply to the sender and cc\n> the original cclist along with the newgroup. Following this newsgroup\n> can be challenging when your schedule is busy, but you can learn alot of\n> really cool stuff by perusing it regularly. I try to keep up daily but\n> alas I am a few days behind.\n>\n>> I am attempting to set up a git repository based on an svn repository.\n>> The idea would be that the members of the project would be able to use\n>> git exclusively with the central git repository acting as the\n>> coordinator. This git server would be the only one capable of issuing\n>> the git svn dcommit and git svn rebase and the members of the project\n>> would not have to worry about it. Eventually, the subversion\n>> repository would be transferred to git.\n>>\n> I have no experience with git-svn (the svn part, that is), but your plan\n> sounds good to me. Read on to see my comments on the parts I do have\n> experience with...\n>\n>> I created a separate Ubuntu VM in order to set up the git repository.\n>> I used \"git svn clone -s\" to set up MyProject.git on \"gitserver\"\n>>\n>> The command \"git branch -a\" shows\n>> * master\n>> remotes/branch1\n>> remotes/branch2\n>> remotes/trunk\n>>\n>>\n>> I then went to my main VM and used ssh to clone the repository\n>>\n>> git clone gitserver:/opt/git/MyProject\n>> cd MyProject\n>> git branch -a\n>> * master\n>> remotes/origin/HEAD -> origin/master\n>> remotes/origin/master\n>>\n>> How do I check out the trunk or appropriate branches from the remote?\n>> I am probably misreading the documentation. Would it be\n>>\n>> git checkout -b branch1\n>>\n\nCorrection: (Please ignore my confusion about \"trunk\" in the previous \npost. I see that by \"trunk\" you mean the \"remotes/trunk\" on gitmaster)\n\n> \"git checkout -b branch1\" will create a new branch called branch1 based\n> on whatever your current HEAD is. HEAD is the commit that you are\n> currently pointing to, ie. the tip of the branch currently checkout out.\n> (see git checkout manpage.) The asterisk indicates above that\n> you are currently on master. Therefore, \"git checkout -b branch1\" will\n> create a new branch called \"branch1\" that has the same history as\n> master. It sounds like you want to checkout \"branch1\", \"branch2\", and\n> \"trunk\". Read on...\n>\n>> does the master on the remote (and here) actually point to the trunk\n>> by default?\n>> should I checkout the branches on \"gitserver\"?\n>>\n> not being familiar with git-svn, but familiar with \"git\", I would advise\n> you to do the following:\n> (1) on \"gitserver\" perform:\n> (a) git branch branch1 remotes/branch1 (this will create a branch called\n> branch1 that tracks remotes/branch1)\n> (b) git branch branch2 remotes/branch2\n> (c) git branch trunk remotes/trunk\n> Now you have the branches master, branch1, branch2, and trunk on\n> \"gitserver\".\n> (2) I don't know how to push from a git repo to an svn repo so I can't\n> tell you if gitserver master points to svn trunk or not. However, read\n> on for what I do know...\n>\n>> I also do not see how I can get the list of branches from the remote\n>> location.without having to do an ssh into the gitserver, cd to the\n>> repository directory, and use a 'branch -a' there. Is there a way to\n>> ask for this information? I have not yet been successful in setting up\n>> gitosis yet because this is on an internal company intranet and I do\n>> not have a valid machine name for my accounts as everything is being\n>> done on VMs. Thus, my public key ends with\n>> \"sabbahillel@desktop-ubuntu\" rather than an actual machine name or\n>> address.\n>>\n> The way you get the list is by doing a git-fetch on MyProject (AFTER you\n> create the branches on gitserver). This will create remote tracking\n> branches for all the branches on gitserver. Notice I said \"branches on\n> gitserver\" and not \"remote tracking branches on gitserver\". You can't\n> track the remote tracking branches of your remote (at least not sanely).\n> Thats why you had to create tracking branches on gitserver that track\n> the remote tracking branches that track the svn repo. Now that you have\n> branches \"branch1\", \"branch2\", and \"trunk\" on gitserver you can track\n> them in MyProject. git-fetch will create remotes/origin/branch1,\n> remotes/origin/branch2, remotes/origin/trunk in MyProject. Now you can\n> do \"git branch branch1 remotes/origin/branch1\" to create the branch1\n> branch in MyProject. \"git checkout branch1\" in MyRepo will check it out.\n> Repeat for branch2 and trunk. (I'm not familiar with ssh details, but I\n> assume your last ssh comment is made into a non-issue by what I just\n> stated above.)\n>\n>> Would you have a pointer to a HOW-TO that discusses this.\n>>\n> I assume these links:\n>\n> http://git-scm.com/course/svn.html\n>\n> https://git.wiki.kernel.org/index.php/GitSvnCrashCourse\n>\n> https://git.wiki.kernel.org/index.php/GitSvnSwitch\n>\n> https://git.wiki.kernel.org/index.php/SvnMigration\n>\n> http://utsl.gen.nz/talks/git-svn/intro.html\n>\n> http://www.tfnico.com/presentations/git-and-subversion\n>\n> or the git-svn manpage:\n>\n> http://www.kernel.org/pub/software/scm/git/docs/v1.7.1.4/git-svn.html\n>\n> will help you. (you need to use the git version of the manual that\n> corresponds to your installation. 1.7.1.4 is relevant to me, but perhaps\n> not to you.)\n>\n>> Thanks for any help that you can give me.\n>>\n>> --\n>> Sabba - סבא הלל - Hillel\n>> Hillel (Sabba) Markowitz | Said the fox to the fish, \"Join me ashore\"\n>> SabbaHillel@gmail.com | The fish are the Jews, Torah is our water\n>> http://sabbahillel.blogspot.com\n>\n> Despite my ignorance regarding svn and git-svn, I hope my comments will\n> be of some help to you or point you in the right direction.\n>\n> v/r,\n> Neal\n>\n"},{"id":"162894","messageId":"AANLkTinzJC5WnrqnYDsrWzO8B=Ye8wjQmYEk0S4w61g9@mail.gmail.com","threadId":"26656","inReplyTo":"4D7441A9.7090505@gmail.com","subject":"Re: Newbie question about setting up git repository from svn (git svn)","fromName":"Hillel (Sabba) Markowitz","fromEmail":"sabbahillel@gmail.com","sentAt":"2011-03-07T03:20:46Z","receivedAt":"2011-03-07T03:20:46Z","isPatch":false,"sender":{"key":"sabbahillel@gmail.com","avatar":"https://gravatar.com/avatar/10987b3bb904d2033ffa8b985ef66947bf70fe07de553c03347f9678886b7528?d=mp&s=160"},"body":"On Sun, Mar 6, 2011 at 9:23 PM, Neal Kreitzinger <nkreitzinger@gmail.com> wrote:\n\n> not being familiar with git-svn, but familiar with \"git\", I would advise you\n> to do the following:\n> (1) on \"gitserver\" perform:\n> (a) git branch branch1 remotes/branch1 (this will create a branch called\n> branch1 that tracks remotes/branch1)\n> (b) git branch branch2 remotes/branch2\n> (c) git branch trunk remotes/trunk\n> Now you have the branches master, branch1, branch2, and trunk on\n> \"gitserver\".\n\n> Despite my ignorance regarding svn and git-svn, I hope my comments will be\n> of some help to you or point you in the right direction.\n>\n> v/r,\n> Neal\n>\n>\n\nThanks, this seems to point to what I want to do. I think that this\nshould give me the information that I want.\n\n\n-- \n       Sabba     -          סבא הלל        -     Hillel\nHillel (Sabba) Markowitz | Said the fox to the fish, \"Join me ashore\"\n SabbaHillel@gmail.com | The fish are the Jews, Torah is our water\nhttp://sabbahillel.blogspot.com\n"}]}