Host your project’s code on Launchpad¶
Important
This document has been migrated from help.launchpad.net as is, and has not yet been revised. The content might be outdated, links and images could be broken. We are aware and will fix any issues as soon as possible.
You can host your project’s source code using Launchpad and Git. If you’re new to Git, or distributed version control in general, take a look at this Git tutorial first.
When you push a Git branch to Launchpad, it’s usually associated with a project that’s also registered in Launchpad. Other people can then get hold of your Git branch, modify it, and push their own version back up to Launchpad for everyone to see.
This guide shows you how to:
tell the world your project uses Launchpad to host its source code
push your first Git branch up to Launchpad
set that branch as your project’s development focus – i.e.
trunkhand the branch over to a team, so several people can commit code to it.
Note
Launchpad is free of charge for open source projects. To host non-open code on Launchpad, check out this doc on consumer hosting <consumer-hosting>.
Enable code hosting for your project¶
First, add your project to Launchpad.
When you’ve done that, visit your your project’s overview page. There
you’ll find a Configuration progress section in the right-hand column.
Click Code and either select an existing branch or
set up a new one.
Push a Git branch to your project¶
You can push and pull code from Launchpad directly from the terminal. If you haven’t already, you need to first add your SSH key to Launchpad.
To push your branch up to Launchpad, open your terminal and go to your Git branch. Set up the remote and push:
git remote add origin git+ssh://username@git.launchpad.net/~username/project-name
git push -u origin branch-name
~username: this is your Launchpad id, which is the portion of your profile page URL that begins with the tildeproject-name: the name of the project in Launchpadbranch-name: whatever name you want to give to your branch, such astrunk,main, orexperimental.
Replace project-name with your project’s Launchpad id. The id is the
final part of your project overview page’s URL: e.g. launchpadlib in
https://launchpad.net/launchpadlib/.
See your branch in place¶
Once Git has pushed your branch to Launchpad, Launchpad will scan the revisions in your branch and:
list the repository on both your own code overview page and that of the project.
enable other people to download the branch and create their own version of it
make the full revision history available in the source-code tab.
Let several people commit to the branch¶
If you want to enable several people to push code to the branch, you’ll need to create a team and make that the branch’s owner.
Go to your project’s code page (https://launchpad.net/project-name), select
the repository you want to change, select Change repository details, and
change Owner to the new team, and save the changes.
Once on the branch’s overview page, you’ll see an information box on the
right-hand side of the page. Click the pencil icon next to your name in
the Maintainer section to enter Change branch details page. Select
from the drop-down menu Maintainer the team that you want to own the
branch.
Next steps¶
You’re now hosting your project’s code in Launchpad. Anyone can download your code, make their changes and upload their branch for listing on your project’s code page. Other people can also propose there branches for merging into your trunk, or any other branch associated with your project.
Read the full guide to working with merge proposals.