---
name: "gbp-pq"
section: "1"
platform: "linux"
package: "git-buildpackage"
version: "0.9.38"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/gbp-pq"
---

# gbp-pq(1)

Manage debian/patches in Git without any need for GNU Quilt

## NAME

gbp-pq - Manage debian/patches in Git without any need for GNU Quilt

## SYNOPSIS

FC**gbp pq**F\[0\]  \[FC**--version**F\[0\]\] \[FC**--help**F\[0\]\] \[FC**--verbose**F\[0\]\] \[FC**--color=**F\[0\]\[auto\|on\|off\]\] \[FC**--color-scheme=**F\[0\] *COLOR\_SCHEME*\] \[FC**--\[no-\]patch-numbers**F\[0\]\] \[FC**--patch-num-format=**F\[0\] *format*\] \[FC**--\[no-\]renumber**F\[0\]\] \[FC**--topic=**F\[0\] *topic*\] \[FC**--time-machine=**F\[0\] *num*\] \[FC**--\[no-\]drop**F\[0\]\] \[FC**--abbrev=**F\[0\] *num*\] \[FC**--force**F\[0\]\] \[FC**--commit**F\[0\]\] \[FC**--meta-closes=bug-close-tags**F\[0\]\] \[FC**--meta-closes-bugnum=bug-number-format**F\[0\]\] \[FC**--pq-from=**F\[0\] *\[DEBIAN\|TAG\]*\] \[FC**--upstream-tag=**F\[0\] *tag-format*\] \[FC**--\[no-\]ignore-new**F\[0\]\] FC**drop**F\[0\] \| FC**export**F\[0\] \| FC**import**F\[0\] \| FC**rebase**F\[0\] \| FC**switch**F\[0\]

## DESCRIPTION

**gbp pq** helps one to manage quilt patches in Debian packages that are maintained with **gbp**. This is especially useful with packages using the 3.0 (quilt) source format. With **gbp pq**, you can maintain the quilt patches that should be applied to a package on a separate branch called patch-queue branch. So if your Debian package lives on *master*, the associated patch-queue branch will be called *patch-queue/master*.

See \
  ⟨https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.patches.html⟩ for example workflows.

## ACTIONS

- FC**import**F\[0\]

  Create a patch queue branch from quilt patches in debian/patches/ that are listed in debian/patches/series. The patches must apply without fuzz.

- FC**export**F\[0\]

  Export the patches on the patch-queue branch associated to the current branch into a quilt patch series in debian/patches/ and update the series file.

- FC**rebase**F\[0\]

  Switch to the patch-queue branch associated to the current branch and rebase it against the current branch.

- FC**drop**F\[0\]

  Drop (delete) the patch queue associated to the current branch. So if you're on branch *foo*, this would drop branch *patch-queue/foo*.

- FC**apply**F\[0\]

  Add a single patch to the patch-queue similar to using **git-am**. Use FC**--topic**F\[0\] if you want the patch to appear in a separate subdir when exporting the patch queue using FC**export**F\[0\]. This can be used to separate upstream patches from Debian specific patches.

- FC**switch**F\[0\]

  Switch to the patch-queue branch if on the base branch and switch to base branch if on patch-queue branch.

## OPTIONS

- FC**--version**F\[0\]

  Print version of the program, i.e. version of the git-buildpackage suite

- FC**-v**F\[0\], FC**--verbose**F\[0\]

  Verbose execution

- FC**-h**F\[0\], FC**--help**F\[0\]

  Print help and exit

- FC**--color=**F\[0\]\[auto\|on\|off\]

  Whether to use colored output.

- FC**--color-scheme=**F\[0\]*COLOR\_SCHEME*

  Colors to use in output (when color is enabled). The format for COLOR\_SCHEME is '\<debug\>:\<info\>:\<warning\>:\<error\>'. Numerical values and color names are accepted, empty fields imply the default color. For example, FC**--git-color-scheme=**F\[0\]FC'cyan:34::'F\[0\] would show debug messages in cyan, info messages in blue and other messages in default (i.e. warning and error messages in red).

- FC**--\[no-\]patch-numbers**F\[0\]

  Whether or not the patch files should be prefixed with a number. The default is to export patches with patch numbers. Note, however, that this normally affects patches whose names are automatically generated, and has no effect on exporting patches which have a FC**Gbp\[-Pq\]: Name**F\[0\] tag, since the name specified is preserved unless the FC**--renumber**F\[0\] option is used.

- FC**--patch-num-format=**F\[0\]*format*

  The format specifier for patch number prefixes. The default format is '%04d-'.

- FC**--\[no-\]renumber**F\[0\]

  Whether or not to renumber patches exported from the patch queue, instead of preserving numbers specified in FC**Gbp-Pq: Name**F\[0\] tags. The default is not to renumber patches. Useful when patches need to be renamed for the sake of uniformity. For example, using FC**--renumber**F\[0\] with FC**--no-patch-num**F\[0\] will strip all numeric prefixes from exported patches.

- FC**--topic=**F\[0\]*topic*

  Topic to use when importing a single patch

- FC**--time-machine=**F\[0\]*NUM*

  When importing a patch queue fails, go back commit-by-commit on the current branch to check if the patch-queue applies there. Do this at most *NUM* times. This can be useful if the patch-queue doesn't apply to the current branch HEAD anymore, e.g. after importing a new upstream version.

- FC**--\[no-\]drop**F\[0\]

  Whether to automatically drop (delete) the patch queue branch after a successful export

- FC**--abbrev=**F\[0\]*NUM*

  When exporting a patch queue abbreviate commit, instead of showing the full 40-byte hexadecimal object name in header lines, show only a partial prefix of length *NUM*. This is useful when existing patches were not generated by **gbp pq**.

- FC**--force**F\[0\]

  In case of FC**import**F\[0\], import even if the patch-queue branch already exists and overwrite its content with FC*debian/patches*F\[0\].

- FC**--commit**F\[0\]

  In case of FC**export**F\[0\], commit FC*debian/patches*F\[0\]the changes to Git after exporting the patches.

- FC**--meta-closes=**F\[0\]*bug-close-tags*

  What meta tags to look for to generate a commit message when using FC**export**F\[0\] FC**--commit**F\[0\]. The default is FC'Closes\|LP'F\[0\] to support Debian and Launchpad.

- FC**--meta-closes-bugnum=**F\[0\]*bug-number-format*

  What regular expression should be used to parse out the bug number when using FC**export**F\[0\] FC**--commit**F\[0\]. The default is FC'(?:bug\|issue)?\\#?\\s?\\d+'F\[0\]. See [**gbp-dch**(1)](/gbp-dch/1.md) for details.

- FC**--pq-from=**F\[0\]*\[DEBIAN\|TAG\]*

  How to find the starting point for the patch queue base. The options are DEBIAN, that will use the Debian branch as the base for the patch queue branch, and TAG, that will use the corresponding upstream tag as a base for the patch queue branch.

  This is only needed if your upstream branch is not merged in the Debian branch. The default is *DEBIAN*.

- FC**--upstream-tag=**F\[0\]*TAG-FORMAT*

  Use this tag format when looking for tags of upstream versions, default is *upstream/%(version)s*.

- FC**--\[no-\]ignore-new**F\[0\]

  Don't abort if there are uncommitted changes in the source tree or the current branch doesn't match the *DEBIAN-BRANCH*.

## TAGS

When exporting patches from a patch-queue branch, **gbp pq** will look at the patch header for special tags it recognizes. All tags need to start at the first column and require at least one whitespace after the colon.

- FC**Gbp\[-Pq\]: Ignore**F\[0\]

  Ignores the commit, no patch is generated out of it.

- FC**Gbp\[-Pq\]: Name**F\[0\] *name*

  The name to use for the patch when running

  ```
  FCgbp pq exportF[0]
  ```

  If unset, it will be formatted like **git am** would format it.

- FC**Gbp\[-Pq\]: Topic**F\[0\] *topic*

  Moves the patch into a subdir called *topic* when running

  ```
  FCgbp pq exportF[0]
  ```

  This allows for some structure below FC*debian/patches*F\[0\].

- FC**Gbp-Pq-Topic:**F\[0\] *topic*

  Deprecated: use FC**Gbp\[-Pq\]: Topic**F\[0\] *topic* instead.

## EXAMPLES

Create a temporary branches-applied branch from files currently in FC*debian/patches/\**F\[0\], and switch to it so that one can easily modify the files directly and manage the metadata as git commits modify the files with git commands (thus avoiding quilt) and manage the metadata as git commits:

```
FC
      gbp pq switch --forceF[0]
```

Re-create the contents of FC*debian/patches/\**F\[0\] using the commits on the patches-applied branch, commit it on the actual Debian packaging branch, and delete the temporary patches-applied branch::

```
FC
      gbp pq export --drop --commitF[0]
```

## SEE ALSO

[**gbp-buildpackage**(1)](/gbp-buildpackage/1.md), [**dpkg-source**(1)](/dpkg-source/1.md), [**quilt**(1)](/quilt/1.md), [**gbp.conf**(5)](/gbp.conf/5.md)

## AUTHOR

Guido Günther \<FCagx@sigxcpu.orgF\[0\]\>
