D.3. Structure of a Git repository

We keep all upstream sources under Git control, in a branch called upstream. This branch usually consists of successive unpacked upstream tarballs. When importing a new upstream tarball, the following command should be used:

  git-import-orig --pristine-tar [--no-dch] <name_version.orig.tar.gz>
The --pristine-tar is mandatory to store information for reconstructing the upstream tarball from the repository. That information is not suited for human use and is stored in the pristine-tar branch. Optionally, --no-dch can be given to automatically update the Debian changelog (without committing it).

The master branch contains upstream sources along with the debian/ directory. git-import-orig automatically creates a (local) tag in the upstream branch, and merges upstream into master when importing a new tarball. Changes related to Debian should be done in this branch.