git-buildpackage tip #1: using gbp-clone to clone a remote repo
18th December 2010
Let's say you want to clone a git repository that has the debian packaging on master and the upstream source is kept on upstream/master (since it tracks upstream's master branch). You can simply use git clone or you can do a
gbp-clone --upstream-branch=upstream/master --pristine-tar git://git.debian.org/git/pkg-lvm/multipath-tools.git
This will additionally set up master, upstream/master and pristine-tar to track the corresponding remote branches. There's no --debian-branch option in the above example since master is the default.
If you want to safely update these branches at a later point invoke
gbp-pull --upstream-branch=upstream/master --pristine-tar
from inside the repository. This will only update the branches if they can be fast-forwarded. If the repository has a debian/gbp.conf describing the branch layout a call to
gbp-pull
is enough.