So far you could import your Git repositories to Canonical’s Launchpad code hosting service a Bazaar branch. But with the growing popularity of Git Launchpad couldn’t shy away from native Git support for long, could it? Yes, Launchpad has introduced Git support as a beta offering. Ubuntu app devs who use services like GitHub can make the most out of it by service their code right out of Launchpad.
The following features are already supported:
- push Git repositories over SSH
- clone repositories over git://, SSH, or HTTPS
- see summary information on repositories and the branches they contain in the Launchpad web UI
- follow links from the Launchpad web UI to a full-featured code browser
- push and clone private repositories, if you have a commercial subscription to Launchpad
- propose merges from one branch to another, including in a different repository of the same project or package
The long term plan is to support every Bazaar feature for Git as well. Those include:
- useful subscriptions (currently only attribute change notifications work)
- RSS feeds
- an integrated code browser
Edit ~/.gitconfig and add the lines below, where USER is your Launchpad username:
[url "git+ssh://USER@git.launchpad.net/"] insteadof = lp:
This allows you to type git clone lp:REPOSITORY.
Using Git with Launchpad
To fetch the default repository for a project, run:
$ git clone lp:PROJECT
git clone lp:launchpad fetches Launchpad itself (or will once te conversion is done).
To keep your local clone up to date, run:
$ git pull
You can add a “remote” to your repository like this, if you own the project:
$ git remote add lp lp:PROJECT
If you do not own the project:
$ git remote add lp lp:~USER/PROJECT
To push a branch, run:
$ git push lp my-changes
Every Git repository hosted on Launchpad has a full “canonical” URL of one of these forms (the URLs are for web browser; you need to change the scheme and host parts for the command-line Git client):
Repository for an upstream project.
Repository for a source package in a distribution.
A “personal” repository with no particular connection to any project or package.
These are unique, an long. In most cases there’s no need for more than one repository per owner and target (project or package). Launchpad therefore has the notion of default repositories. A repository can be the default for a target, in which case it has one of these forms:
Default repository for an upstream project.
Default repository for a source package in a distribution.
A repository can also be a person’s or a team’s default for a target, in which case it has one of these forms:
Owner’s default repository for an upstream project.
Owner’s default repository for a source package in a distribution.