gbp-import-ref(1)
gbp-import-ref β the manual page, but make it fashion π
okay bestie, so this is gbp-import-ref from the git-buildpackage manual, and it's about to be your new fave. it keeps your upstream sources fresh in a git-only workflow, no tarballs, no drama. let's get into it π¦
β¨ NAME β¨
gbp-import-ref β update upstream sources in a git only workflow
β¨ SYNOPSIS β¨
gbp import-ref [--version] [--help] [--verbose] [--color=[auto|on|off]]
[--color-scheme= COLOR_SCHEME] [--upstream-version=
version] [--merge-mode= [auto|merge|replace]]
[--upstream-branch= branch_name] [--upstream-tag=
tag_format] [--upstream-tree= [BRANCH|VERSION|commit-id]]
[--debian-branch= branch_name] [--[no-]sign-tags]
[--keyid= gpg-keyid] [--postimport=cmd] [--[no-]rollback]
look at her. she's serving options. π
β¨ DESCRIPTION β¨
so gbp import-ref merges upstream git commits onto your debian-branch. that's the whole gig. π
and you've got three whole ways to tell it what to bring in:
- specify a branch to merge
- give it an upstream version
- specify the commit id directly
and here's the lil bonus: if no tag exists for the imported commit, it gets automatically created. no extra steps, we love a self-sufficient queen π
β¨ OPTIONS β¨
--versionβ prints the version of the program, like, the version of the whole git-buildpackage suite π-v,--verboseβ verbose execution. she'll tell you everything she's doing, oversharing era fr fr-h,--helpβ prints help and exits. classic.--color=[auto|on|off]β whether to use colored output. yes the vibes are configurable π--color-scheme=COLOR_SCHEMEβ the colors to use in output (when color is enabled, obvs). the format forCOLOR_SCHEMEis'<debug>:<info>:<warning>:<error>'. numerical values and color names are both accepted, and an empty field means "just use the default color, bestie". for example,--git-color-scheme='cyan:34::'would show debug messages in cyan, info messages in blue, and other messages in default β meaning warning and error messages come out in red π₯--upstream-version=version,-uversionβ the upstream version to merge. the upstream tag it uses gets determined via--upstream-tag. so you say the version, she finds the tag, slay.--merge-mode=[auto|merge|replace]β how to fold the upstream commits onto the Debian packaging branch. this one's important, pay attention π«Άmergedoes a Git merge and leaves you on your own if there's a merge conflict to resolve. good luck bestie πreplacemode, on the other hand, makes the head of the Debian packaging branch identical to the newly imported tree, but preserves the content of thedebian/directory β while keeping the current head as well as the newly imported tree as parents of the generated commit. it's basically a theirs merge strategy while preservingdebian/. iconic behaviour tbh- the default is
auto, which usesreplacefor3.0 (quilt)packages andmergeotherwise. she picks for you β¨
--upstream-branch=branch_nameβ the branch in the Git repository where the upstream sources live. default isupstream.--upstream-tag=tag-formatβ use this tag format when looking up upstream tags. default isupstream/%(version)s.--upstream-tree=[BRANCH|VERSION|commit-id]β what to merge into thedebian-branch.BRANCHmerges from the upstream branch.VERSION(which is the default) looks for a tag determined from the given upstream version number via the--upstream-versionoption. any other value gets interpreted as a git commit id to merge from.--debian-branch=branch_nameβ the branch in the Git repository where the Debian package is being developed. default ismaster.--[no-]sign-tagsβ GPG sign all created tags. security, but make it cute π--keyid=gpg-keyidβ use this keyid for gpg signing tags.--import-msg=msg-formatβ use this format string for the commit message when importing upstream versions. default isNew upstream version %(version)s. she said write your own but here's a good one.--postimport=cmdβ runcmdafter the import. the hook gets these environment variables passed to it, so jot them down bestie:GBP_BRANCHβ the name of the Debian packaging branchGBP_TAGβ the name of the just created upstream tagGBP_UPSTREAM_VERSIONβ the just imported upstream versionGBP_DEBIAN_VERSIONβ the Debian version of the package with a Debian revision of'-1'
--[no-]rollbackβ rollback changes in case of an error. the "undo" button, the safety net, the parachute πͺ
β¨ EXAMPLES β¨
merge commits from the upstream-branch into the debian-branch, creating a tag for the version 0.0~git20180524:
gbp import-ref --upstream-tree=BRANCH -u0.0~git20180524
merge commits from the tag corresponding to version 1.0:
gbp import-ref --upstream-tree=VERSION -u1.0
merge commits given by a SHA1, creating a tag for the version 0.0~git20180524:
gbp import-ref --upstream-tree=c4398912c -u0.0~git20180524
so three examples, three vibes, all valid π
β¨ CONFIGURATION FILES β¨
several gbp.conf files get parsed to set defaults for all those command-line arguments up there. if you wanna know the deets, go read the gbp.conf(5) manpage. iykyk π
β¨ SEE ALSO β¨
gbp-buildpackage(1), gbp-import-dsc(1), gbp-import-dscs(1), gbp-dch(1), gbp.conf(5), uscan(1), debuild(1), git(1), pristine-tar(1), The Git-Buildpackage Manual β¨file:///usr/share/doc/git-buildpackage/manual-html/index.htmlβ©
the whole friend group, honestly π«Ά
β¨ AUTHOR β¨
Guido GΓΌnther <agx@sigxcpu.org>
ty for your service, king π
and that's the page, bestie! this one came from the git-buildpackage Manual, version dated 26 May 2026. go forth and import your refs, you're gonna do amazing πβ¨π
π¦ where this page comes from
- ubuntu stonking: git-buildpackage 0.9.43 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms