gbp-import-orig(1)
β¨ gbp-import-orig β¨
okay bestie, this is the page for gbp-import-orig from the git-buildpackage manual. She's a whole queen π
and she's about to make importing upstream sources into your git repo actually cute. Let's get into it π«Ά
πΈ NAME πΈ
gbp-import-orig β Import an upstream source from tarball, or git tag and tarball, into a git repository π
π SYNOPSIS π
gbp import-orig [--version] [--help] [--verbose] [--color=[auto|on|off]]
[--color-scheme= COLOR_SCHEME] [--upstream-version=
version] [--[no-]merge] [--merge-mode=
[auto|merge|replace]] [--upstream-branch= branch_name]
[--debian-branch= branch_name] [--upstream-vcs-tag= tag-
format] [--[no-]sign-tags] [--keyid= gpg-keyid]
[--upstream-tag= tag-format] [--filter= pattern]...
[--component= component]... [--[no-]pristine-tar]
[--[no-]filter-pristine-tar] [--[no-]symlink-orig]
[--postimport=cmd] [--postunpack=cmd]
[--[no-]interactive] [--[no-]rollback]
[--upstream-signatures=[auto|on|off]] filename | url |
--uscan
π¦ DESCRIPTION π¦
So gbp import-orig imports upstream sources into a Git repository, and optionally links them to upstream's git history. And it can pull from three sources, periodt:
filename: a file sitting on your local file system. Gzip, bzip2, lzma and xz compressed tar archives, zip archives, and already-unpacked source trees are all supported. very giving πurl: the tarball gets downloaded from a http or https url. Heads up β this needs thepython3-requestpackage installed. no cap.--uscan: the latest upstream or the version you specify gets fetched via uscan, relying ondebian/watch. iconic.
If the tarball's name is already in the form package-name_version.orig.tar.gz, then the version info is determined straight from the tarball's filename. Otherwise you can hand it over on the command line with --upstream-version. And if the source package name or version just can't be figured out, gbp import-orig will prompt for it β unless you gave --no-interactive. π«Ά
The sources get placed on the upstream branch (default: upstream), tagged, and merged onto the debian branch (default: master). That happens either using a plain git merge, or by creating a whole new tree that is the new upstream version plus the debian/ directory. The second one is what gets used for source format 3.0 (quilt) packages, because direct modifications of the upstream sources are not allowed in that format, so a 1:1 replacement of the upstream sources is almost always what you want. You can tweak that with --merge-mode. β¨
When you use the --upstream-vcs-tag option, the tag matching the version of the imported release gets added as an additional parent of the commit created for the imported tarball. This ties the upstream git commit history to the Debian packaging history, and it lets you do things like easy cherry-picking of patches and comparing upstream git against the upstream tarball. lowkey genius.
If there's an error, gbp import-orig will rollback (undo) all the changes it has made to the repository (see the --rollback option). it's got your back π
Also! For projects using multiple tarballs, the names of the additional components need to be specified via the--componentcommand line option or viagbp.conf(details below, bestie).
π OPTIONS π
--versionβ Print the version of the program, i.e. the version of the git-buildpackage suite. she's showing off her ID π-v,--verboseβ Verbose execution. tell me everything, queen.-h,--helpβ Print help and exit.--color=[auto|on|off]β Whether to use colored output. aesthetic decisions matter β¨--color-scheme=COLOR_SCHEMEβ Which colors to use in the output (when color is enabled, obviously). The format forCOLOR_SCHEMEis'<debug>:<info>:<warning>:<error>'. Numerical values and color names are both 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). custom palette, obsessed π¨--upstream-version=version,-uversionβ The upstream version number. With--uscan, it's passed to uscan as--download-version.--[no-]mergeβ Merge the upstream branch to the Debian branch after import.--merge-mode=[auto|merge|replace]β How to fold the newly imported upstream source into the Debian packaging branch after import.mergedoes a Git merge, leaving 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. This is similar to atheirsmerge strategy while preservingdebian/. iconic behaviour honestly.- The default is
auto, which usesreplacefor 3.0 (quilt) packages andmergeotherwise.
--upstream-branch=branch_nameβ The branch in the Git repository the upstream sources are put onto. Default isupstream.--debian-branch=branch_nameβ The branch in the Git repository the Debian package is being developed on, default ismaster. After importing the new sources on the upstream branch,gbp import-origwill try to merge the new version onto this branch.--upstream-vcs-tag=tag-formatβ Addtag-formatas an additional parent to the commit of the upstream tarball. Useful when upstream uses git and you want to link to its revision history. Thetag-formatcan be a pattern similar to what--upstream-tagsupports.--[no-]sign-tagsβ GPG sign all created tags. secure her π--keyid=gpg-keyidβ Use this keyid for gpg signing tags.--upstream-tag=tag-formatβ Use this tag format when tagging upstream versions, default isupstream/%(version)s.--import-msg=msg-formatβ Use this format string for the commit message when importing upstream versions, default isNew upstream version %(version)s.--filter=patternβ Filter out files glob-matchingpattern. This option can be given multiple times.--component=COMPONENTβ When importing the upstream tarball also look for an additional tarball with component nameCOMPONENT. E.g. inhello-debhelper_1.0.orig-foo.tar.gzthe component would befoo. The additional tarball is expected to be in the same directory as the upstream tarball and to use the same compression type. You also need to specify the components when using--uscan.
Using additional original tarballs is a feature of the 3.0 (quilt) source format. See the dpkg-source manpage for details. This is currently considered an experimental feature and might change incompatibly. β οΈ
--[no-]pristine-tarβ Generate pristine-tar delta file.--[no-]filter-pristine-tarβ If using a filter, also filter the files out of the tarball passed to pristine-tar.--[no-]symlink-origβ Whether to create and keep a symlink from the upstream tarball to a Debian policy conformant upstream tarball name located in../.
This is a good idea if you're not using pristine-tar, since it avoids creating a new tarball with a different md5sum. π«Ά
--postimport=cmdβ Runcmdafter the import. The hook gets the following environment variables passed to it: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'
--postunpack=cmdβ Runcmdafter the import. This can be useful to e.g. convert or remove certain files prior to the import. The hook gets passed the following environment variables:GBP_TMP_DIRβ the temporary directory the tarballs are unpacked into.GBP_SOURCES_DIRβ the temporary directory where the unpacked sources are.GBP_GIT_DIRβ the directory of the git repository where the tarball will be imported into.
--uscanβ Use uscan to fetch a new upstream version. The version can be specified with--upstream-version. β¨--[no-]interactiveβ Run command interactively, i.e. ask for the package name and version if needed.--[no-]rollbackβ Rollback changes in case of an error. the safety net, we love her π--upstream-signatures=[auto|on|off]β Whether upstream signatures should be imported as well (when using pristine-tar).offturns this off completely, whileonalways tries to import a signature (which can be useful if you want it to fail when e.g. uscan did not fetch a signature). The defaultautomeans to import a signature file if present but do nothing otherwise.
π EXAMPLES π
Download and import a new upstream version using the information from debian/watch:
gbp import-orig --uscan
Fetch a tarball from an URL:
gbp import-orig https://debian.example.com/sid/upstream-tarball-0.1.tar.gz
Import a local tarball:
gbp import-orig ../upstream-tarball-0.1.tar.gz
π CONFIGURATION FILES π
Several gbp.conf files get parsed to set defaults for the command-line arguments above. See the gbp.conf(5) manpage for the details, bestie π«Ά
π 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β© πΈ
π AUTHOR π
Guido GΓΌnther <agx@sigxcpu.org> β thank you king π«‘
so yeah, that's the whole page! this was version-of-the-page from the git-buildpackage suite, dated 26 May 2026, and it's gbp-import-orig(1) obviously π
go forth and import, bestie. slay. β¨ππ¦
π¦ 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