gbp-dch(1)
β¨ NAME β¨
okay so welcome to gbp-dch(1), straight out of the git-buildpackage manual πΈ this is the tool that generates your debian/changelog from your Git commit history, and honestly? she eats. let's get into it π
gbp-dch β Generate the debian/changelog from Git commit history π¦
π SYNOPSIS π
gbp dch [--version] [--help] [--verbose] [--color=[auto|on|off]]
[--color-scheme= COLOR_SCHEME] [--debian-branch= branch_name]
[--debian-tag= tag-format] [--upstream-branch= branch_name]
[--upstream-tag= tag-format] [--ignore-branch] [-s commit-ish |
--since= commit-ish] [[-S | --snapshot] | [-R | --release]] [-N
version | --new-version= version] [--bpo | --nmu | --qa |
--security | --team | --lts | --stable | --local= suffix]
[--distribution= name] [--force-distribution] [-U level |
--urgency= level] [--[no-]full] [--[no-]meta]
[--meta-closes=bug-close-tags]
[--meta-closes-bugnum=bug-number-format] [--snapshot-number=
expression] [--id-length= number] [--git-log= git-log-options]
[--[no-]git-author] [--[no-]multimaint]
[--[no-]multimaint-merge]
[--spawn-editor=[always|never|snapshot|release]] [--commit-msg=
msg-format] [-c | --commit] [--customizations= customization-
file] [--postedit= COMMAND] [--dch-opt= dch-options]...
[--verbose] path1 path2
π DESCRIPTION π
so like, gbp dch reads your git commit messages and literally builds the Debian changelog out of them π«Ά she starts at whatever commit you tell her with --since and walks all the way up to the current HEAD. every commit she finds? her message gets added to the changelog. periodt.
if you don't give her --since, she figures out the starting commit herself using these rules (and she takes the first one that matches, no debate):
- the start commit gets read from the snapshot banner (more on that below, bestie)
- if the topmost version of the
debian/changelogis already tagged β she uses whatever commit that tag points to as the start commit - otherwise the last commit that modified
debian/changelogbecomes the start commit
this whole lil auto-deduction thing? it's called automatic mode β¨ iconic behaviour tbh
now π if the distribution of the topmost section in debian/changelog is UNRELEASED, your changelog entries get inserted right into that section. if it's literally anything else, she creates a brand new section for you.
if you pass one or more paths as arguments, gbp dch will only include changes in debian/changelog that affect those paths. like, throwing debian/ in there is a whole vibe if upstream uses Git and you do not want their whole history showing up in your debian/changelog π
want to restrict things even more? use the --git-log option β it gets passed on verbatim to git log. for example: --git-log="--author=Foo Bar" and boom, only Foo Bar's commits π
all of the above relies on --debian-branch pointing at your current branch and --upstream-branch pointing at the corresponding upstream branch, so she can find the right merge points between them. and also, gbp dch has to be able to identify git tags from upstream and Debian version numbers. so if you're not running the defaults, please check --upstream-tag and --debian-tag and make sure they actually match the tags created by, like, gbp import-orig (if you're using tarballs) or upstream's own tagging pattern (if you're using upstream's git directly). trust me, check them π
and lastly: if no changelog exists yet? she creates one for you. and the version number gets derived from the last upstream tag if she can find one π
π OPTIONS π
strap in, there are a lot of them, and every single one is here, no cap.
--versionβ prints the version of the program, aka the version of the wholegit-buildpackagesuite β¨-v,--verboseβ verbose execution. she tells you everything she's doing π£οΈ-h,--helpβ print help and exit, the classic π«Ά--color=[auto|on|off]β whether to use colored output or not π--color-scheme=COLOR_SCHEMEβ which colors to use in the output (only when color is enabled, obvi). the format forCOLOR_SCHEMEis'<debug>:<info>:<warning>:<error>'. numerical values and color names both work, and empty fields just mean "use 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). cute, right? π--debian-branch=branch_nameβ the branch in the Git repo where the Debian package is being developed. default ismaster.--upstream-branch=branch_nameβ the branch used to determine the upstream version from. default isupstream.--git-upstream-tag=TAG-FORMATβ use this tag format when looking for tags of upstream versions. default isupstream/%(version)s.--ignore-branchβ don't check if the current branch matchesdebian-branch. living dangerously, love that for you π--debian-tag=tag-formatβ the tag format used when tagging debian versions. default isdebian/%(version)s.--since=commit-ishβ start reading commit messages at commit-ish. heads up: this option can't be set viagbp.confβ οΈ--auto,-aβ this option is ignored, it's only there for compatibility with older versions. it used to trigger automatic mode, back in the day.--[no-]metaβ parse meta tags likeCloses:,Thanks:andGbp-Dch:. see META TAGS below for the tea π--meta-closes=bug-close-tagsβ which meta tags to look for when generating bug-closing changelog entries. the default is'Closes|LP', so both Debian and Launchpad are supported π--meta-closes-bugnum=bug-number-formatβ which regular expression to use when parsing out the bug number. the default is'(?:bug|issue)?\#?\s?\d+'. note: the regex should suppress all portions of the bug number you don't want by using"(?:)"β go read the Python regex manual for the details, iykyk.
example: --meta-closes-bugnum="(?:bug)?\s*ex-\d+" would match all of the following:
Possible Txt Match? Result
------------ ------ ------
bug EX-12345 Y EX-12345
ex-01273 Y ex-01273
bug ex-1ab Y ex-1
EX--12345 N
--[no-]fullβ include the full commit message in the changelog output. the whole thing, not just the subject line πΈ--snapshot,-Sβ create a snapshot release entry. it uses a snapshot release number that's smaller than the final release number, and it slaps a warning banner onto the changelog entry. the version number gets auto-incremented with every new snapshot release π₯
the snapshot banner is also what gbp dch uses to figure out which entries are already in the changelog. this is what stops you from getting duplicated entries in debian/changelog when you haven't committed the changelog yet. she's looking out for you π«Ά
--snapshot-number=expressionβ a Python expression that getseval()ed to produce the new snapshot number. yes,eval(). yes, that's really what it does.--release,-Rβ removes any snapshot release banners and version suffixes (if any), sets the current distribution tounstable, and opens the changelog up for final tweaking π this option can't be set viagbp.conf. it's usually what you reach for to finalize the changelog right before making a release.--new-version=version,-N versionβ add a new changelog section with version newversion. if you combine it with--snapshot, the snapshot number gets appended to newversion. this option can't be set viagbp.confβ οΈ--teamβ create a Team upload changelog entry. this option can't be set viagbp.conf.--bpoβ increment the Debian release number for an upload to backports, and add a backport upload changelog comment. this option can't be set viagbp.conf.--nmuβ increment the Debian release number for a non-maintainer upload. this option can't be set viagbp.conf.--qaβ increment the Debian release number for a Debian QA Team upload, and add a QA upload changelog comment. this option can't be set viagbp.conf.--securityβ increment the Debian release number for a Debian Security Team non-maintainer upload, and add a"Security Team upload"changelog comment. this option can't be set viagbp.confπ--ltsβ increment the Debian release number for a Debian LTS Team upload, and add a LTS upload changelog comment. this option can't be set viagbp.conf.--stableβ increment the Debian release number for an upload to the current stable release. this option can't be set viagbp.conf.--local=suffix,-l suffixβ increment the Debian release number for a local build, using the suffix you specify. this option can't be set viagbp.confπ--distribution=nameβ set the distribution field to name. this option can't be set viagbp.conf.--force-distributionβ force the distribution you gave to--distributionto actually be used, even if it doesn't match the list of known distributions. this option can't be set viagbp.confπ--urgency=levelβ set the urgency field to level.--git-log=git-log-optionsβ options passed on verbatim togit-log(1). verbatim means verbatim, bestie.--id-length=Nβ include N digits of the commit id in the changelog entry. by default she doesn't include any commit ids at all.--ignore-regex=regexβ ignore commit lines matching regex when generating the changelog.--git-authorβ useuser.nameanduser.emailfromgit-config(1)for the changelog trailer π--[no-]multimaint-mergeβ this option gets passed verbatim todch(1)and is enabled by default.--spawn-editor=[always|never|snapshot|release]β whether to spawn an editor:always,never, only when doing snapshots, or only when doing a release. your call πΈ--commit-msg=msg-formatβ use this format string for the commit message when committing the generated changelog file (only relevant when--commitis given). the default isUpdate changelog for %(version)s releaseβ¨--commitβ commit the generated changelog. she'll do it for you π--customizations=customization-fileβ load Python code from customization-file. right now the only genuinely useful thing that code can do is define a customformat_changelog_entry()function.--postedit=COMMANDβ runCOMMANDafter changes to the changelog file have been finalized. and by finalized i mean: afterdchhas been run and any possible text editor has been exited, but before changes are (possibly) committed to git. timing is everything, fr fr β°--dch-opt=dch-optionβ pass an option todchverbatim. note:gbp dchinvokesdchmultiple times and the option gets passed to all the invocations, so not alldchoptions make sense here. and some of them may straight up conflict with options thatgbp dchitself picked. you've been warned π
more of this page incoming bestie, don't go anywhere π¦
β¨ SNAPSHOT MODE β¨
Ok bestie, this one is so handy for when you're doing quick test-and-install cycles and you literally cannot be bothered to think about version numbers or write changelog entries. Snapshot mode has your back. π«Ά
So when you use --snapshot or -S, gbp dch sticks a pseudo header in the Debian changelog to remember the last git commit it added a changelog entry for. It also sets a version number ending in ~<snaspshotnumber>.gbp<commitid>. π
And the cute part? It automatically increments the snapshot number on subsequent invocations of gbp dch -S, so later snapshots automatically get a higher version number. No manual bumping, no drama. β¨
To leave snapshot mode, just invoke gbp dch with the --release option. That removes the pseudo header and unmangles the version number so the released version has a higher version number than the snapshots. Iconic behaviour, honestly. π
π·οΈ META TAGS π·οΈ
Additional to the above options, the formatting of the commit message in debian/changelog can be modified by special tags (they're called Meta Tags) that you drop right into the git commit message. Meta Tag processing gets activated via the --meta option. πΈ
Rules of the game:
- The tags must start at the first column of a commit message, but they can appear on any line.
- They're of the form
Tagname: value.
Valid Meta Tags are:
Gbp-Dch: actionβ supported actions are:Ignoreβ which will ignore this commit when generatingdebian/changelogShortβ which will only use the description (the first line) of the commit message when generating the changelog entry (super useful when--fullis given)Fullβ which will use the full commit message when generating the changelog entry (super useful when--fullis not given)
In addition to Gbp-Dch, the deprecated Git-Dch is still supported. (Deprecated, bestie β it still works, but don't go building your whole personality around it. π)
Thanks: msgβ add a thanks message after the commit message. Being nice is free, periodt. πCloses: bugnumberβ indicate in thedebian/changelogthat the bug was closed by this commit. See the--meta-closeson how to extend this for other bugtrackers.
So like, this git commit message:
Document meta tags
so one doesn't have to consult the manual
Gbp-Dch: Short
Closes: #636088
Thanks: RaphaΓ«l Hertzog for the suggestion
Results in this debian/changelog entry:
* Document meta tags.
Thanks to RaphaΓ«l Hertzog for the suggestion (Closes: #636088)
Look at that. Gorgeous. It's giving automation with taste. π¦
π EXAMPLES π
Update the changelog for release
Update the latest debian/changelog so the package is ready for release, and commit the change. An editor will be spawned so the entry can be reviewed and manually refined easily. βοΈ
gbp dch --release --commit
Changelog after a new upstream import
Right after running git import-orig --uscan, create a new debian/changelog entry for UNRELEASED, and include only commits that modified something in the debian/ subdirectory so all upstream commits are ignored: π
gbp dch --distribution=UNRELEASED \
--commit --commit-msg="Update changelog after new upstream version import" \
-- debian
The -- debian is doing main character energy work there, ngl. π₯
π§ CONFIGURATION FILES π§
Several gbp.conf files are parsed to set defaults for the above command-line arguments. See the gbp.conf(5) manpage for the details, bestie. π
π SEE ALSO π
gbp-buildpackage(1)gbp-import-dsc(1)gbp-import-dscs(1)gbp-import-orig(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β©
- Cl2vcs β¨https://honk.sigxcpu.org/cl2vcsβ©
π AUTHOR π
Guido GΓΌnther <agx@sigxcpu.org>
And that's the whole thing, babes β this page is dated 26 May 2026 and belongs to gbp-dch(1). Go forth and write changelogs like the icon you are. π
β¨π
π¦ 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