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

# gbp-import-ref(1)

Update upstream sources in a git only workflow

## NAME

gbp-import-ref - Update upstream sources in a git only workflow

## SYNOPSIS

FC**gbp import-ref**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**--upstream-version=**F\[0\] *version*\] \[FC**--merge-mode=**F\[0\] *\[auto\|merge\|replace\]*\] \[FC**--upstream-branch=**F\[0\] *branch\_name*\] \[FC**--upstream-tag=**F\[0\] *tag\_format*\] \[FC**--upstream-tree=**F\[0\] *\[BRANCH\|VERSION\|commit-id\]*\] \[FC**--debian-branch=**F\[0\] *branch\_name*\] \[FC**--\[no-\]sign-tags**F\[0\]\] \[FC**--keyid=**F\[0\] *gpg-keyid*\] \[FC**--postimport=cmd**F\[0\]\] \[FC**--\[no-\]rollback**F\[0\]\]

## DESCRIPTION

**gbp import-ref** merges upstream git commits onto your FC**debian-branch**F\[0\] You can either specify a branch to merge, give an upstream version or specify the commit id directly. If no tag exists for the imported commit it will be automatically created.

## 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**--upstream-version**F\[0\]=*version*, FC**-u**F\[0\]*version*

  The upstream version to merge. The upstream tag to use will be determined via the FC**--upstream-tag**F\[0\].

- FC**--merge-mode=**F\[0\]*\[auto\|merge\|replace\]*

  How to fold the upstream commits onto the Debian packaging branch.

  *merge* does a Git **merge** leaving you on your own in case of merge conflict resolution.

  *replace* mode on the other hand makes the head of the Debian packaging branch identical to the newly imported tree but preserves the content of the FC*debian/*F\[0\] directory while keeping the current head as well as the newly imported tree as parents of the generated commit. This is similar to a FC**theirs**F\[0\] merge strategy while preserving FC*debian/*F\[0\].

  The default is *auto* which uses *replace* for 3.0 (quilt) packages and *merge* otherwise.

- FC**--upstream-branch**F\[0\]=*branch\_name*

  The branch in the Git repository the upstream sources are on. Default is *upstream*.

- FC**--upstream-tag=**F\[0\]*tag-format*

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

- FC**--upstream-tree=**F\[0\]*\[BRANCH\|VERSION\|commit-id\]*

  What to merge into the FC**debian-branch**F\[0\]. *BRANCH* merges from the upstream branch. *VERSION* (the default) looks for a tag determined from the given upstream version number via the FC**--upstream-version**F\[0\] option.

  Other values are interpreted as git commit id to merge from.

- FC**--debian-branch**F\[0\]=*branch\_name*

  The branch in the Git repository the Debian package is being developed on, default is *master*.

- FC**--\[no-\]sign-tags**F\[0\]

  GPG sign all created tags.

- FC**--keyid=**F\[0\]*gpg-keyid*

  Use this *keyid* for gpg signing tags.

- FC**--import-msg=**F\[0\]*msg-format*

  Use this format string for the commit message when importing upstream versions, default is *New upstream version %(version)s*.

- FC**--postimport=**F\[0\]*cmd*

  Run *cmd* after the import. The hook gets the following environment variables passed:

  - **GBP\_BRANCH**

    The name of the Debian packaging branch

  - **GBP\_TAG**

    The name of the just created upstream tag

  - **GBP\_UPSTREAM\_VERSION**

    The just imported upstream version

  - **GBP\_DEBIAN\_VERSION**

    The Debian version of the package with a Debian revision of '-1'

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

  Rollback changes in case of an error.

## EXAMPLES

Merge commits from the FC**upstream-branch**F\[0\] into the FC**debian-branch**F\[0\] creating a tag for the version *0.0~git20180524*:

```
FC
    gbp import-ref --upstream-tree=BRANCH -u0.0~git20180524F[0]
```

Merge commits from the tag corresponding to version *1.0*:

```
FC
    gbp import-ref --upstream-tree=VERSION -u1.0F[0]
```

Merge commits given by a SHA1 creating a tag for the version *0.0~git20180524*

```
FC
    gbp import-ref --upstream-tree=c4398912c -u0.0~git20180524F[0]
```

## CONFIGURATION FILES

Several FC*gbp.conf*F\[0\] files are parsed  to set defaults for the above command-line arguments. See the [**gbp.conf**(5)](/gbp.conf/5.md) manpage for details.

## SEE ALSO

[**gbp-buildpackage**(1)](/gbp-buildpackage/1.md), [**gbp-import-dsc**(1)](/gbp-import-dsc/1.md), [**gbp-import-dscs**(1)](/gbp-import-dscs/1.md), [**gbp-dch**(1)](/gbp-dch/1.md), [**gbp.conf**(5)](/gbp.conf/5.md), [**uscan**(1)](/uscan/1.md), [**debuild**(1)](/debuild/1.md), [**git**(1)](/git/1.md), [**pristine-tar**(1)](/pristine-tar/1.md),\
        The Git-Buildpackage Manual ⟨file:///usr/share/doc/git-buildpackage/manual-html/index.html⟩

## AUTHOR

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