How to use git-buildpackage

General information about how gbp works

git-buildpackage works around two main branches:

In addition to this, gbp has support for pristine-tar (a nice feature to recreate tarballs identical to upstream ones). Using the --pristine-tar option, a new branch called "pristine-tar" is added, containing some delta files used to recreate the tarball. git-import-dsc or git-import-orig. You probably want to enable this option in your gbp.conf

In the team we want commits about one thing only. If you change several things, please put each of them in a separate commit, with its own descriptive message.

gbp configuration files

gbp has a system-wide configuration file in /etc/git-buildpackage/gbp.conf. Users can override it via ~/.gbp.conf.

Further, per-package configuration is available through debian/gbp.conf. Similarly, .git/gbp.conf is used as a per-repo configuration file.

Common tasks

For some common tasks, a list of procedures is given here. For the procedures, follow the links to the sections below.

Basic procedures

Starting a Debian package from scratch

Create a working directory and initialize a git repo in it:

Then import the upstream tarball and launch dh-make to deploy the usual debian/ boilerplate:

Now you have a gbp repository with two or three branches (master, upstream and pristine-tar if you enabled --pristine-tar), and you can start working as usual.

Importing an existing package

In details, this command will:

Once done, you can start working as usual.

Creating a repository on Alioth

Checking out a repository

Building a package

git-buildpackage <options>

Options are passed on to debuild, but you can easily configure it to use something else, or to integrate it with good stuff like pbuilder or cowbuilder. Please refer to the manual for more information

Creating patches

Create patches normally using quilt or dpkg-source. Make sure you add a good description to each patch.

Pushing into the repository

Both the master and upstream branch are stored on Alioth. However, the upstream branch doesn't change except when a new upstream version is imported, so at other times you don't need to worry about it.

Finalizing a package

If you need to be sponsored, build a source package and dput it to http:// mentors.debian.net, otherwise move on to the next section.

Uploading a package

Updating a package to a new upstream version

If you have a watch file, just tell gbp:

Otherwise, pass it the upstream tarball:

References