| gbp-clone(1) | git-buildpackage Manual | gbp-clone(1) |
gbp-clone - Clone a Git repository from a remote and set up the necessary branch tracking
gbp clone
[--version] [--help] [--verbose]
[--color=[auto|on|off]] [--color-scheme= COLOR_SCHEME]
[--all] [--[no-]pristine-tar] [--debian-branch=
branch_name] [--upstream-branch= branch_name]
[--depth= depth] [--reference= repository]
[--postclone= COMMAND] [--[no-]hooks]
[--defuse-gitattributes= [auto|on|off]] [--repo-user=
[GIT|DEBIAN]] [--repo-email= [GIT|DEBIAN]]
[--[no-]aliases] [--[no-]add-upstream-vcs] repository
[directory]
Unlike a regular git clone, the gbp clone will parse the debian/gbp.conf options and clone the remote repository with correct branches tracked.
Likewise, it is recommended to use gbp pull and gbp push to later update the repository as it will spare from having to run git pull and git push multiple times or with lengthy arguments to sync each tracked branch.
Exported environment variables are: GBP_GIT_DIR (the repository the package is being built from).
Note that if you clone a repository that contains a hook configuration in debian/gbp.conf this hook will not be run automatically to prevent execution of untrusted code.
If set to auto, first check whether there are any .gitattributes files in the upstream source, and act only if there are some. If set to on, unconditionally there are some. If set to off, does nothing.
Clone the Debian packaging repository and the upstream repository in one go:
gbp clone -add-upstream-vcs vcs-git:entr
The branches, tags and pristine-tar will be automatically setup correctly following the contents of debian/gbp.conf in the package, and there will be an additional git remote with the name upstreamvcs that points to the upstream Entr repository on GitHub.
A parameter on the command line would override anything in the debian/gbp.conf file. For example, clone a repository and setup a tracking branch for pristine-tar as well:
gbp clone --pristine-tar git://honk.sigxcpu.org/git/git-buildpackage.git
Clone from the Git-Vcs URL of a package:
gbp clone vcs-git:libvirt
Clone a repository from Salsa (Debian's code hosting):
gbp clone salsa:agx/git-buildpackage
Clone from a GitHub repository:
gbp clone github:agx/git-buildpackage
Several gbp.conf files are parsed to set defaults for the above command-line arguments. See the gbp.conf(5) manpage for details.
gbp-buildpackage(1), gbp-pull(1), gbp-setup-gitattributes(1), gbp.conf(5), gitattributes(5)
Guido Günther <agx@sigxcpu.org>
| 10 April 2025 |