Strumenti Utente

Strumenti Sito


use_launchpad_with_git

Parts of this HOWTO are work in progress.

READ HERE FIRST

This howto is currently a lie, it doesn't work, because of this bug.

Introduction

Launchpad only supports Bazaar as content versioning tool, and presumably always will since Canonical, the company behind both, wants to push its usage.

Lots of people prefer Git as content versioning tool. I am one of those. However, Launchpad does offer other very nice features, such as the localization system which can automatically push contributors-translated strings into your repo.

So it is natural to ask: is it possible to use Launchpad with git? Or even better: is it possible to migrate an already existing bzr branch pushed on bazaaar to git?

Quick remark: in many places it is suggested to just use the fastimport method: it's OK for a one-time migration, but not to represent a durable two-ways bridge!

Yes, it is possible

Thanks to bzr-git (package bzr-git in Debian/Ubuntu).

Let's assume you have a bzr branch in “~/bzr_branch” and you want to work in a git repo at “~/git_repo”. Once you have bzr-git installed, just

  1. mkdir ~/git_repo
  2. cd ~/git_repo
  3. git init
  4. cd ~/bzr_branch
  5. bzr push ~/git_repo
  6. cd ~/git_repo
  7. git checkout

Edit the file ~/bzr_branch/.bzr/branch/branch.conf, which should look like the following:

parent_location = ../git_repo
push_location = bzr+ssh://your_lp_id@bazaar.launchpad.net/the/branch/path

(“the/branch/path” is usually “~your_lp_id/project_name/branch_name”).

Now you can work in your git repo as you love to. When you want to push changes to Launchpad, just

  1. cd ~/bzr_branch
  2. bzr pull
  3. bzr push

TODO

  1. verify that merging in changes from Launchpad is similarly easy
  2. verify which quantity of magic can be done with git hooks
  3. verify how bzr-git behaves with respect to branches (does it pulled master? or checked one?)
use_launchpad_with_git.txt · Ultima modifica: 2011/02/15 11:04 da toobaz