[debian] [free software] [free knowledge] [sharing]

Packaging a new upstream version (using git)

Description: Basic steps to package a new upstream version of an existing package using git

Language(s): English

Check that there is a new upstream version:

uscan --report

Download the new upstream version:


Import this new version to git:

gbp import-orig --pristine-tar ../PKGNAME_NEWVERSION.orig.tar.gz -u NEWVERSION

If you forget the –prisitne-tar option, you can cretae the pristine-tar with:

pristine-tar commit ../PKGNAME_NEWVERSION.orig.tar.gz

Update debian/changelog:

dch -v NEW_VERSION-1

Add the following item:

  * New upstream release.

It's very important to update changelog before building. If we don't do it, a file in debian/patches will be created since it'll be understood that you are making changes to the code.

Commit this change:

git commit -a -m "New upstream release"

Do whatever is needed.

Build the package:

gbp buildpackage --git-pbuilder -d

Or if you have uncommitted changes:

gbp buildpackage --git-pbuilder --git-ignore-new -d

Run lintian:

lintian -i -I --show-overrides --pedantic PKGNAME_NEWVERSION-1_ARCH.changes

Try to make the package lintian free, do all needed changes/commits and build as many times as you need to make the package ready to upload.

Install and test the package:


Check that there are not weird changes comparing the new package with the old one:


Do this last commit:

dch -r
git commit -a -m "Releasing to sid"

And build again:

gbp buildpackage --git-pbuilder

Sign the package (if it has not been done during the last command):

debsign PKG_NAME*changes

Upload the package:

dput PKG_NAME*changes

Add tags to the git repo:

gbp buildpackage --git-tag-only

Push changes (if you haven't done it before) anf tags:

git push alioth
git push alioth --tags