gbp-clone(1)

πŸ’– gbp-clone β€” the manual, but make it make sense πŸ’–

okay bestie, pull up a chair, because gbp-clone (from the git-buildpackage suite, the gbp clone command you'll actually type) is about to become your new fave. she clones a Git repo from a remote and sets up all the branch tracking for you. no cap. ✨


🌸 NAME 🌸

gbp-clone β€” clone a Git repository from a remote and set up the necessary branch tracking 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

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]

πŸ‘‘ DESCRIPTION πŸ‘‘

so like, a regular git clone is fine and all, but gbp clone is not like other girls. she parses the debian/gbp.conf options and clones the remote repository with the correct branches tracked. it's giving ✨competence✨.

and while we're here β€” bestie, it is recommended to use gbp pull and gbp push to update the repo later, because that spares you from having to run git pull and git push a million times or with lengthy arguments just to sync each tracked branch. the way that saves us so many keystrokes πŸ˜­πŸ’…


✨ OPTIONS ✨

  • --version β€” print the version of the program, like the version of the git-buildpackage suite. cute, quick, iconic.
  • -v, --verbose β€” verbose execution. she tells you everything πŸ‘€
  • -h, --help β€” print help and exit. your little emergency exit πŸšͺ
  • --color=[auto|on|off] β€” whether to use colored output. decorate the terminal, girl 🌈
  • --color-scheme=COLOR_SCHEME β€” the colors to use in output (when color is enabled, obvs). the format for COLOR_SCHEME is '<debug>:<info>:<warning>:<error>'. Numerical values and color names are accepted, and empty fields imply the default color. for example, --git-color-scheme='cyan:34::' would show debug messages in cyan, info messages in blue and other messages in default (i.e. warning and error messages in red). four little fields, four little moods πŸ’œ
  • --all β€” track all branches, not only debian and upstream. collector behavior, honestly.
  • --debian-branch=branch_name β€” the branch in the Git repository the Debian package is being developed on. default is master.
  • --upstream-branch=branch_name β€” the branch in the Git repository the upstream sources are put onto. default is upstream.
  • --depth=depth β€” Git history depth, for creating shallow git clones. surface level only, and that's valid 🫧
  • --reference=repository β€” local repository to use as alternate instead of re-copying data from the remote repository. recycling! we love her ♻️
  • --pristine-tar β€” track pristine tar branch. yes ma'am πŸŽ€
  • --[no-]hooks β€” enable running hooks.
  • --postclone=COMMAND β€” execute COMMAND after cloning the source from the remote. the exported environment variables are: GBP_GIT_DIR (the repository the package is being built from).
heads up bestie: 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. safety first, always πŸ”’
  • --defuse-gitattributes=[auto|on|off] β€” disable Git attributes that may interfere with building packages. works by updating .git/info/attributes to override attributes in the upstream sources which may cause files to be transformed on checkout. more specifically, a new macro attribute is defined, [attr]dgit-defuse-attrs, which is then applied to * together with export-subst and export-ignore. this is done to be compatible with dgit and git-deborig which disable Git attributes this way. 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. auto is the vibe-check setting πŸ¦‹
  • --repo-email=[GIT|DEBIAN] β€” when set to DEBIAN, use the DEBEMAIL environment variable to set the user.email Git configuration, otherwise use Git's defaults.
  • --repo-user=[GIT|DEBIAN] β€” when set to DEBIAN, use the DEBFULLNAME environment variable to set the user.name Git configuration, otherwise use Git's defaults.
  • --[no-]aliases β€” whether to expand gbp specific aliases for remote repos like salsa:. shortcuts are so main character πŸ’…
  • --[no-]add-upstream-vcs β€” whether to add the upstream git repository as an additional remote. the repository url is read from the "Repository" field in debian/upstream/metadata. bringing the whole friend group along 🫢
  • repository β€” the (possibly remote) repository to clone from. this is usually a Git URL but some shortcuts are supported (see below). iykyk πŸ‘€
  • directory β€” the directory to clone to.

πŸŽ€ EXAMPLES πŸŽ€

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. one command, whole ecosystem. periodt. πŸ”₯

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

🧚 CONFIGURATION FILES 🧚

several gbp.conf files are parsed to set defaults for the above command-line arguments. see the gbp.conf(5) manpage for details. your config file is basically your journal, bestie πŸ““


🌈 SEE ALSO 🌈

gbp-buildpackage(1), gbp-pull(1), gbp-setup-gitattributes(1), gbp.conf(5), gitattributes(5)

go read the rest of the friend group, they're all iconic πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

Guido GΓΌnther <agx@sigxcpu.org> β€” the legend herself 🫑


and that's the whole page, bestie!! this was the git-buildpackage Manual version 26 May 2026 of gbp-clone(1). now go clone something slay βœ¨πŸ’–πŸŒΈπŸ¦‹πŸ’…

πŸ“¦ where this page comes from