gbp-import-dsc(1)

πŸ’– gbp-import-dsc(1) β€” git-buildpackage Manual πŸ’–

okay bestie, sit down, hydrate, because this one is about importing an entire Debian source package into a Git repo and it's lowkey the glow-up your packaging workflow has been waiting for. ✨


🌸 NAME 🌸

gbp-import-dsc β€” drop a Debian source package into a Git repository like it's nothing πŸŽ€


✨ SYNOPSIS ✨

gbp import-dsc [--version] [--help] [--verbose] [--color=[auto|on|off]]
               [--color-scheme= COLOR_SCHEME] [--allow-same-versions]
               [--author-date-is-committer-date] [--author-is-committer]
               [--debian-branch= branch_name] [--debian-tag= tag-format]
               [--filter= pattern]... [--keyid= gpg-keyid]
               [--[no-]create-missing-branches] [--[no-]pristine-tar]
               [--[no-]sign-tags] [--skip-debian-tag]
               [--upstream-branch= branch_name] [--upstream-tag= tag-
               format] [--upstream-vcs-tag= tag-format] [--repo-user=
               [GIT|DEBIAN]] [--repo-email= [GIT|DEBIAN]] debian-
               source.dsc [target]
gbp import-dsc [options] [--[no-]allow-unauthenticated] URL [target]

(nope, those line breaks are not a typo, that's literally how the synopsis is written πŸ’…)


πŸ’… DESCRIPTION πŸ’…

So like β€” gbp import-dsc takes a Debian source package, yeets it into a Git repository, notes the package version in the commit logs, and commits the whole thing. And it's not out here making you do homework: package name, version, Debian modifications, upstream source β€” all of it is automatically detected from the source package. After the import you can just... use the rest of the gbp tools on it. iconic. πŸ‘‘

Now here's the vibe check on where it lands:

  • If you run the command from inside an existing Git repository, it imports into that one. no cap.
  • If you're not in a repo, it creates a new one, named after the Debian source package.
  • Wanna pick a different spot? Pass the optional target argument and it'll set up the new repo wherever you say. 🫢

And if you hand it a URL, gbp import-dsc will download the source package before importing it. dget handles basically every scheme β€” except the special apt:/// scheme, which uses apt-get instead (meaning yes bestie, you need deb-src entries in your /etc/apt/sources.list for that one). Also you can shorten it to the pseudo URL apt: because we're efficient around here. ⭐


πŸ”₯ OPTIONS πŸ”₯

  • --version β€” prints the version of the program, aka the version of the git-buildpackage suite. ✨
  • -v, --verbose β€” verbose execution, so you can watch everything happen in real time. she's chatty.
  • -h, --help β€” print help and exit. the classic escape hatch.
  • --color=[auto|on|off] β€” whether to use colored output at all. say yes, the colors are cute. 🌈
  • --color-scheme=COLOR_SCHEME β€” which 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 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 β€” meaning warning and error messages come out in red. 🎨
  • --upstream-branch=branch_name β€” the branch in the Git repository where the upstream sources get put. Default is upstream.
  • --debian-branch=branch_name β€” the branch in the Git repository where the debian sources get put. Default is master.
  • --[no-]sign-tags β€” GPG sign all created tags. πŸ”
  • --keyid=gpg-keyid β€” use this keyid for gpg signing tags.
  • --debian-tag=tag-format β€” use this tag format when tagging Debian versions; default is debian/%(version)s.
  • --upstream-tag=tag-format β€” use this tag format when tagging upstream versions; default is upstream/%(version)s.
  • --upstream-vcs-tag=tag-format β€” adds tag-format as an additional parent to the commit of the upstream tarball. Super useful when upstream uses git and you want to link to its revision history. The tag-format can be a pattern similar to what --upstream-tag supports. The default is to not add upstream tags as additional parents, since this requires additional setup to have the upstream sources in the same repository.
  • --skip-debian-tag β€” don't create the Debian tag after importing the Debian patch. Handy if you already created a package but want to keep working on it after importing it into git. πŸ™ˆ
  • --filter=pattern β€” filter out files glob-matching pattern from upstream tarballs and the debian tarball of 3.0(quilt) packages. Note that the .diff.gz of 1.0 source format packages is currently not filtered. 🫠 This option can be given multiple times.
  • --pristine-tar β€” generate a pristine-tar delta file.
  • --allow-unauthenticated β€” whether to skip signature verification on downloads. It's passed on verbatim to dget and apt-get respectively. Use with care.
  • --allow-same-version β€” allows you to import a package with the same debian version. (the flag name in the synopsis says --allow-same-versions, but the option itself is --allow-same-version β€” iykyk πŸ‘€)
  • --author-is-committer β€” when importing the Debian patch, use the author identity as the committer identity.
  • --author-date-is-committer-date β€” when importing the Debian patch, use the author date as the committer date.
Warning ⚠️ Git will subtly misbehave if the committer date of a commit is not later than or equal to all its parents. fr fr, don't do it unless you know what you're doing. πŸ’€
  • --[no-]create-missing-branches β€” create the upstream and debian branch if they're missing.
  • --repo-user=[GIT|DEBIAN] β€” when set to DEBIAN, it uses the DEBFULLNAME environment variable to set the user.name Git configuration; otherwise it uses Git's defaults. Only affects newly created repos. 🌱
  • --repo-email=[GIT|DEBIAN] β€” when set to DEBIAN, it uses the DEBEMAIL environment variable to set the user.email Git configuration; otherwise it uses Git's defaults. Only affects newly created repos. 🌱

🧚 CONFIGURATION FILES 🧚

Several gbp.conf files get parsed to set defaults for all those command-line arguments up there. The details live in the gbp.conf(5) manpage β€” go read it, bestie. πŸ’œ


🌟 EXAMPLES 🌟

Download and import a source package from a URL:

gbp import-dsc http://http.debian.net/debian/pool/main/h/hello/hello_2.10-1.dsc

Ensure that the local git repository has the latest version of the package available in Debian unstable, by downloading and attempting to import the source package via apt-get source:

gbp import-dsc apt:hello/sid

Import a source package in the local file system:

gbp import-dsc ../hello_2.10-1.dsc

πŸ’– SEE ALSO πŸ’–

gbp-import-dscs(1), gbp-buildpackage(1), gbp-import-orig(1), gbp-dch(1), apt-get(1), sources.list(5), dget(1), gbp.conf(5), 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 for your service, king 🫢


aaaand that's the whole page, bestie! this one's from the 26 May 2026 snapshot of the git-buildpackage manual β€” go import something and slay. πŸ’…βœ¨πŸ¦‹πŸ“

πŸ“¦ where this page comes from