{"id":6,"date":"2008-08-25T23:38:01","date_gmt":"2008-08-25T23:38:01","guid":{"rendered":"http:\/\/tech.moosaico.com\/blog\/2008\/08\/25\/convert-a-project-to-git-from-a-cvs-repository-in-ubuntu-hardy-804\/"},"modified":"2008-08-25T23:38:01","modified_gmt":"2008-08-25T23:38:01","slug":"convert-a-project-to-git-from-a-cvs-repository-in-ubuntu-hardy-804","status":"publish","type":"post","link":"https:\/\/thejoyofstick.com\/blog\/2008\/08\/25\/convert-a-project-to-git-from-a-cvs-repository-in-ubuntu-hardy-804\/","title":{"rendered":"Convert a project to GIT from a CVS repository in Ubuntu Hardy 8.04"},"content":{"rendered":"<p>For some time I was trying to get in touch with git but haven&#8217;t got any project to really use it. That is, one I could convert from CVS or SVN and don&#8217;t have the other group members hit me.<\/p>\n<p>Having a needed patch to the <a href=\"http:\/\/www.moo.mud.org\/\" target=\"_blank\" title=\"LambdaMOO Mud Server Software\">LambdaMOO<\/a> server make it a really interesting candidate.<\/p>\n<p>We are going to extract all the versions of the server from <a href=\"http:\/\/sourceforge.net\/projects\/lambdamoo\/\" target=\"_blank\" title=\"Sourceforge's LambdaMOO\">Sourceforge<\/a> to create a local git repository and then browse around it.<\/p>\n<p><strong>Installation of the needed packages<\/strong><\/p>\n<p>Let&#8217;s go right away to the packages we will need. Start by the base for git.<\/p>\n<pre lang=\"linux\">\r\n$ sudo apt-get install git-core<\/pre>\n<p>Then the cvs related package. There is a <a href=\"http:\/\/www.kernel.org\/pub\/software\/scm\/git\/docs\/gitcvs-migration.html\" title=\"Importing a CVS archive\" target=\"_blank\">git tutorial<\/a> that tells you to also install CVSps.<\/p>\n<pre lang=\"linux\">\r\nsudo apt-get install cvs cvsps<\/pre>\n<p>I though this was enough but mindo from MOOsaico warned me I would need just another one<\/p>\n<pre lang=\"linux\">\r\nsudo apt-get install git-cvs<\/pre>\n<p>Now we have all the ingredients to cook what we want.<\/p>\n<p><strong>Importing from the CVS repository<\/strong><\/p>\n<p>Let&#8217;s fetch the repository from sourceforge. We will use the following command template<\/p>\n<pre lang=\"linux\">\r\ngit cvsimport -C <destination> <module><\/pre>\n<p>making a directory &#8220;destination&#8221; with the repository from the CVS &#8220;module&#8221;.<\/p>\n<p>When asked for a password just press enter.<\/p>\n<pre lang=\"linux\">\r\n$ cvs -d:pserver:anonymous@lambdamoo.cvs.sourceforge.net:\/cvsroot\/lambdamoo login\r\n$ git cvsimport -d:pserver:anonymous@lambdamoo.cvs.sourceforge.net:\/cvsroot\/lambdamoo -C server-git server\r\nInitialized empty Git repository in \/home\/paf\/src\/lambdamoo\/server-git\/.git\/\r\nCounting objects: 1395, done.\r\nCompressing objects: 100% (1393\/1393), done.\r\nWriting objects: 100% (1395\/1395), done.\r\nTotal 1395 (delta 1077), reused 0 (delta 0)<\/pre>\n<p>This make take several minutes. Just wait.<\/p>\n<pre lang=\"linux\">\r\ncd server-git\r\ngitk<\/pre>\n<p>Enjoy now the graphically ((Instead of gitk you may prefer giggle: <code>sudo apt-get install giggle<\/code>)) view of the revisions.<\/p>\n<p><strong>Adding a branch<\/strong><\/p>\n<p>Creating a branch is really difficult in git: you will have to use the &#8230; branch command :-)<\/p>\n<p>To make a branch named <code>iconv<\/code> type<\/p>\n<pre lang=\"linux\">\r\n$ git branch iconv\r\n$ git branch\r\nAUTOCONF_TWO\r\nCONSTANTS\r\nFLOATSUSPEND\r\nINLINEPC\r\nPARC\r\nUNSAFE_OPTS\r\nWAIF\r\nWROGUE\r\niconv\r\n* master\r\norigin<\/pre>\n<p>And you can also see all the existent branches.<\/p>\n<p>But to do some work you must change your context to your branch<\/p>\n<pre lang=\"linux\">\r\n$ git checkout iconv\r\nSwitched to branch \"iconv\"<\/pre>\n<p>Then edit, add, remove files. ((Don&#8217;t forget to use the <code>add<\/code> command and check the <a href=\"http:\/\/www.kernel.org\/pub\/software\/scm\/git\/docs\/gittutorial.html\" title=\"gittutorial\" target=\"_blank\">git tutorial<\/a> to learn more.))<\/p>\n<p>Don&#8217;t forget to save your changes in the repository and afterwards if you want switch back to the master branch.<\/p>\n<pre lang=\"linux\">\r\n$ git commit -a\r\n$ git checkout master<\/pre>\n<p>To play a bit more check melo&#8217;s <em><a href=\"http:\/\/www.simplicidade.org\/notes\/archives\/2008\/06\/git_starters.html\" title=\"Git starters\" target=\"_blank\">Git starters<\/a><\/em> post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For some time I was trying to get in touch with git but haven&#8217;t got any project to really use it. That is, one I could convert from CVS or SVN and don&#8217;t have the other group members hit me.&hellip; <a href=\"https:\/\/thejoyofstick.com\/blog\/2008\/08\/25\/convert-a-project-to-git-from-a-cvs-repository-in-ubuntu-hardy-804\/\" class=\"more-link\">Continue Reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9,8,4],"tags":[],"class_list":["post-6","post","type-post","status-publish","format-standard","hentry","category-moo","category-scm","category-ubuntu"],"jetpack_shortlink":"https:\/\/wp.me\/pcmwlL-6","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":0,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts\/6\/revisions"}],"wp:attachment":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/media?parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/categories?post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/tags?post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}