STG-EXPORT(1)
β¨ STG-EXPORT(1) β the StGit manual, bestie edition β¨
okay so real talk, this is a page from the StGit Manual, and it's about stg-export, which is lowkey one of the most underrated lil commands in the whole suite. buckle up π
πΈ NAME πΈ
stg-export β export patches to a directory. that's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
stg export [OPTIONS] [patch]...
π DESCRIPTION π
so what it does is: it takes a range of patches and exports them to a given directory in unified diff format. iconic. and by default, all applied patches get exported β not me just assuming you wanted that, it literally is the default π
where do they go? patches land in patches-<branch> by default (yep, the directory name is literally built from the branch name). if that's not your vibe, the --dir option lets you specify a different output directory. slay.
and here's the fun part β you can customize the patch file output via a template file, which gets found at one of these spots:
"$GIT_DIR/patchexport.tmpl", "~/.stgit/templates/patchexport.tmpl", or "$(prefix)/share/stgit/templates".
and the following variables are supported in the template file, fr fr:
%(description)s - patch description
%(shortdescr)s - the first line of the patch description
%(longdescr)s - the rest of the patch description, after the first line
%(diffstat)s - the diff statistics
%(authname)s - author name
%(authemail)s - author email
%(authdate)s - patch creation date (ISO-8601 format)
%(commname)s - committer name
%(commemail)s - committer email
like, %(authdate)s gives you the patch creation date in ISO-8601 format β so tidy of it. π«Ά
π OPTIONS π
-b <branch>,--branch=<branch>β use<branch>instead of current branch. main character energy: you pick the branch, not the branch pick you.-d <dir>,--dir=<dir>β export patches to<dir>instead of the default. you're the director now π¬-p,--patchβ suffix patch file names with".patch". yes bestie, literally that exact string.-e <ext>,--extension=<ext>β suffix patch file names with".<ext>". so like, your own custom extension. cute.-n,--numberedβ prefix patch file names with order numbers. keeps everything in line, no chaos π-t <file>,--template=<file>β use<file>as template. this is where you flex your formatting.-s,--stdoutβ export to stdout instead of directory. no files, just vibes (and text) β¨-O <option>,--diff-opt=<option>β pass additional<option>togit diff. see thegit-diff(1)man page for the details. and heads up: this option may be specified multiple times, so stack 'em if you got 'em.
π STGIT π
part of the StGit suite β see stg(1) π§
and that's the whole page, bestie β go forth and export some patches π
this page ships with StGit 2.7.0, dated 10/17/2026. no cap. π
π¦ where this page comes from
- opensuse-leap 16.0: stgit 2.7.0-bp160.1.1 Β· GPL-2.0-only
- opensuse-leap 16.0: stgit 2.7.0-bp160.1.1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms