{"id":1379,"date":"2016-02-01T20:22:35","date_gmt":"2016-02-01T08:22:35","guid":{"rendered":"http:\/\/p-s.co.nz\/wordpress\/?p=1379"},"modified":"2016-02-01T20:22:35","modified_gmt":"2016-02-01T08:22:35","slug":"launchpad-bazaar-to-git","status":"publish","type":"post","link":"http:\/\/p-s.co.nz\/wordpress\/launchpad-bazaar-to-git\/","title":{"rendered":"Launchpad &#8211; Bazaar to Git"},"content":{"rendered":"<p>I&#8217;ve stored my <a href=\"http:\/\/www.sofastatistics.com\" target=\"_blank\">SOFA Statistics<\/a> code on launchpad since 2009 and used bazaar (bzr) to do it. But a lot has changed since then and I know use git on a daily basis in my job. So I&#8217;d much rather use git for SOFA. Fortunately that is now possible on launchpad.<\/p>\n<p>I found <a href=\"https:\/\/help.launchpad.net\/Code\/Git\" target=\"_blank\">https:\/\/help.launchpad.net\/Code\/Git<\/a> to be useful apart from the migration instructions. These didn&#8217;t work for me. For example, I had no luck installing sudo apt-get install bzr-fastimportInstead I found <a href=\"https:\/\/design.canonical.com\/2015\/01\/converting-projects-between-git-and-bazaar\/\" target=\"_blank\">https:\/\/design.canonical.com\/2015\/01\/converting-projects-between-git-and-bazaar\/<\/a>.<\/p>\n<p>Need ~\/.bazaar\/plugins<\/p>\n<p>If plugins folder not there, cd ~\/.bazaar; mkdir plugins<br \/>\n<code><br \/>\ncd ~\/.bazaar\/plugins<\/code><br \/>\n<code><br \/>\nbzr branch lp:bzr-fastimport fastimport<\/code><\/p>\n<p><code>cd ~\/projects\/SOFA\/sofastatistics\/sofa.repo\/sofa.main\/<\/code><\/p>\n<p><code>git init<\/code><\/p>\n<p><code>bzr fast-export --plain . | git fast-import<\/code><br \/>\n<code><br \/>\ngitk --all<\/code><\/p>\n<p>YES! It&#8217;s all there<\/p>\n<p>Archive .bzr in case<\/p>\n<p>USER is launchpad-p-s in my case (yes &#8211; a strange choice which made sense at the time)<\/p>\n<p>PROJECT is sofastatistics<\/p>\n<p>So as per<br \/>\n<code>[url \"git+ssh:\/\/USER@git.launchpad.net\/\"]<br \/>\n        insteadof = lp:<\/code><\/p>\n<p>added the following to ~\/.gitconfig<\/p>\n<p><code>[url \"git+ssh:\/\/launchpad-p-s@git.launchpad.net\/\"]<br \/>\n        insteadof = lp:<\/code><\/p>\n<p>Note &#8211; if not using lp: etc I had trouble with my ssh key &#8211; possibly something to do with confusion between user g and user launchpad-p-s.<\/p>\n<p>I own my own project so to implement git remote add origin lp:PROJECT I ran:<\/p>\n<p><code>git remote add origin lp:sofastatistics<\/code><\/p>\n<p>Note: would only work if insteadof setting added to ~\/.gitconfig as described earlier <a href=\"https:\/\/help.launchpad.net\/Code\/Git\" target=\"_blank\">https:\/\/help.launchpad.net\/Code\/Git<\/a><\/p>\n<p>Otherwise I would have to  git remote add origin git+ssh:\/\/git.launchpad.net\/sofastatistics<\/p>\n<p>As per https:\/\/launchpad.net\/PROJECT\/+configure-code. I.e.<\/p>\n<p><code>https:\/\/launchpad.net\/sofastatistics\/+configure-code<\/code><\/p>\n<p>Confirmed by making a check folder then cloning the code in: git clone git:\/\/git.launchpad.net\/~launchpad-p-s\/sofastatistics<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve stored my SOFA Statistics code on launchpad since 2009 and used bazaar (bzr) to do it. But a lot has changed since then and I know use git on a daily basis in my job. So I&#8217;d much rather &hellip; <a href=\"http:\/\/p-s.co.nz\/wordpress\/launchpad-bazaar-to-git\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,11],"tags":[],"class_list":["post-1379","post","type-post","status-publish","format-standard","hentry","category-open-source","category-programming"],"_links":{"self":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/1379"}],"collection":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/comments?post=1379"}],"version-history":[{"count":1,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/1379\/revisions"}],"predecessor-version":[{"id":1380,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/1379\/revisions\/1380"}],"wp:attachment":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/media?parent=1379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/categories?post=1379"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/tags?post=1379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}