STG-EMAIL(1)
π STG-EMAIL(1) π
StGit Manual β okay bestie, buckle up: this is the stg-email page, and we are gonna make patch emails make sense. β¨
πΈ NAME πΈ
stg-email - format and send patches as email. No cap, thatβs the whole gig. π
π¬ SYNOPSIS π¬
stg email format [OPTIONS] <patch>...
stg email format [OPTIONS] --all
stg email send [OPTIONS] <file|directory>...
stg email send [OPTIONS] <patch>...
stg email send [OPTIONS] --all
stg email send --dump-aliases
stg email help format
stg email help send
stg email help help
π DESCRIPTION π
Format and send patches as email. Thatβs the vibe. π
The classic workflow is: first generate email files for each patch, plus an optional cover letter, using stg email format. Then, after checking the email filesβ contents, send the emails using stg email send. This workflow may be condensed to one step by specifying patch names to stg email send instead of email files. Lowkey efficient, fr fr.
The format and send subcommands are thin wrappers over git format-patch and git send-email, respectively. Refer to the git-format-patch(1) and git-send-email(1) manpages for more details about configuration and options. Iconic delegation behavior. π«
π§ COMMANDS π§
format
Format selected patches as email files, one patch per file. The files are formatted to resemble a UNIX mailbox (mbox) and may be sent with the stg email send command. The first line of the patchβs commit message is used to form the emailβs subject with the remainder of the message in the emailβs body. Cute, organized, slay. π
The patches to format may be specified as individual patch names or patch ranges of the form p0..p3, or --all may be used to format all applied patches. Note that the specified patches must be contiguous within the patch series. Contiguous, bestie β no little gaps in the lineup. π«Ά
By default, the email files will be output to the current directory, however use of the -o/--output-directory option is recommended since sending the email with stg email send <dir> is simpler than specifying all the email files individually. Trust: the directory route is the main character move. π
A cover letter template may also be generated by specifying --cover-letter. A cover letter is recommended when sending multiple patches. The format.coverLetter configuration value may be set true to always generate a cover letter or auto to generate a cover letter when formatting more than one patch. π
Recipients may be specified using the --to and --cc, or setting recipients may be deferred to stg email send. Either way, the address situation can be handled here or later. π
Many aspects of the format behavior may be controlled via format.* configuration values. Refer to the git-config(1) and git-format-patch(1) man pages for more details. Iykyk. β¨
send
Send patches as emails. This is a wrapper for git send-email. Refer to the git-send-email(1) man page for additional details. π
The patches to send may be specified as files or directories generated by stg email format, or as patch names/ranges as would be supplied to stg email format. Specifying a directory will send all files in that directory. One directory, all the emails β highkey satisfying. ποΈπ
The header of the email is configurable via command line options. The user will be prompted for any necessary information not specified on the command line or in the configuration. So if you forgot something, the prompt has your back. π
Many aspects of the send behavior may be controlled via the sendemail.* configuration options. In particular, it is recommended to statically configure SMTP details such as sendemail.smtpServer, sendemail.smtpUser, etc. Refer to git-config(1) and git-send-email(1) man pages for more detail on all the available configuration options. Set those SMTP details once, thank yourself forever. π
π FORMAT OPTIONS π
-b <branch>,--branch=<branch>β use<branch>instead of the current branch. Branch switch-up, but make it patch-email official. πΏ-a,--allβ format all applied patches. Every applied patch gets the email glow-up. β¨-G <option>,--git-opt=<option>β pass additional<option>togit format-patch. See thegit-format-patch(1)man page. This option may be specified multiple times. You can stack these like accessories. π-o <dir>,--output-directory=<dir>β use<dir>to store the output files instead of the current working directory. Put the email files somewhere cute and organized. π--cover-letterβ in addition to the patches, generate a cover letter file containing the branch description, shortlog and the overall diffstat. You can fill in a description in the file before sending it out. Cover letter era. π-n,--numberedβ use[PATCH n/m]even with a single patch. Numbering when you donβt technically need numbering? Bold. π₯-N,--no-numberedβ use[PATCH]even with multiple patches. No numbers, just vibes. π¦--start-number=<n>β start numbering at<n>instead of1. Custom starting point, because why not. β-v <n>,--reroll-count=<n>β mark the series as the<n>-th iteration of the topic. The output filenames havev<n>prepended to them, and the subject prefix (PATCHby default, but configurable via the--subject-prefixoption) hasv<N>appended to it. E.g.--reroll-count=4may producev4-0001-add-makefile.patchfile that hasSubject: [PATCH v4 1/20] Add makefilein it.<N>does not have to be an integer (e.g.--reroll-count=4.4, or--reroll-count=4rev2are allowed), but the downside of using such a reroll-count is that the range-diff/interdiff with the previous version does not state exactly which version the new iteration is compared against. Messy version math? Itβs giving βtechnically allowed, slightly chaotic.β π--rfcβ alias for--subject-prefix="RFC PATCH". RFC means "Request For Comments"; use this when sending an experimental patch for discussion rather than application. Discussion mode: activated. π£οΈβ¨--subject-prefix=<prefix>β instead of the standard[PATCH]prefix in the subject line, instead use[<prefix>]. This allows for useful naming of a patch series, and can be combined with the--numberedoption. Custom label, custom little crown. π--quietβ do not print the names of the generated files. Shhh. π€«-s,--signoffβ add aSigned-off-bytrailer to the commit message, using the committer identity of yourself. See the signoff option ingit-commit(1)for more information. Sign your name, bestie. βοΈ--numbered-filesβ output file names will be a simple number sequence without the default first line of the commit appended. Just numbers. Clean, minimal, suspiciously chill. π’--suffix=<suffix>β instead of using.patchas the suffix for generated filenames, use specified suffix. A common alternative is--suffix=.txt. Leaving this empty will remove the.patchsuffix. Suffix customization is real. π-k,--keep-subjectβ do not strip/add[PATCH]from the first line of the commit log message. Keep the subject exactly as it is. π«Ά--no-binaryβ do not output contents of changes in binary files, instead display a notice that those files changed. Patches generated using this option cannot be applied properly, but they are still useful for code review. Careful, bestie: not properly applicable β but valid for review. π--zero-commitβ output an all-zero hash in each patchβsFromheader instead of the hash of the commit. Zero hash, zero drama. β--to=<address>β add aTo:header to the email headers. This is in addition to any configured headers, and may be used multiple times. The negated form--no-todiscards allTo:headers added so far (from config or command line). More recipients, moreTo:energy. π--no-toβ discard allTo:addresses added so far from config or command line. Bye-bye,To:list. π«‘--cc=<address>β add aCc:header to the email headers. This is in addition to any configured headers, and may be used multiple times. The negated form--no-ccdiscards allCc:headers added so far (from config or command line). Cc: the whole group chat. π―--no-ccβ discard allCc:addresses added so far from config or command line. Clear the Cc: bench. π§Ή--in-reply-to=<message-id>β make the first mail (or all the mails with--no-thread) appear as a reply to the given<message-id>, which avoids breaking threads to provide a new patch series. Thread continuity, we love to see it. π§΅--add-header=<header>β add an arbitrary header to the email headers. This is in addition to any configured headers, and may be used multiple times. For example,--add-header="Organization: git-foo". Custom headers? We stan. π--attachβ createmultipart/mixedattachment, the first part of which is the commit message and the patch itself in the second part, withContent-Disposition: attachment. Attachment behavior, very official. π--inlineβ createmultipart/mixedattachment, the first part of which is the commit message and the patch itself in the second part, withContent-Disposition: inline. Same structure, inline disposition. π--thread[=<style>]β controls addition ofIn-Reply-ToandReferencesheaders to make the second and subsequent mails appear as replies to the first. Also controls generation of theMessage-IDheader to reference. The optional<style>argument can be eithershallowordeep.shallowthreading makes every mail a reply to the head of the series, where the head is chosen from the cover letter, the--in-reply-to, and the first patch mail, in this order.deepthreading makes every mail a reply to the previous one. The default is--no-thread, unless theformat.threadconfiguration is set. If--threadis specified without a style, it defaults to the style specified byformat.threadif any, or elseshallow. Beware that the default forgit send-emailis to thread emails itself. If you wantgit format-patchto take care of threading, you will want to ensure that threading is disabled forgit send-email. Threading lore drop, bestie. π§΅β¨--no-threadβ disable message threading. No thread, no reply chain. Simple. π¦--signature=<signature>β add a signature string to each email. The default signature is the git version number, or theformat.signatureconfiguration value, if specified. The signature may be disabled with--no-signature. Signature moment. β¨--no-signatureβ do not add a signature to each email. No signature, no extra text. π«Ά--signature-file=<file>β like--signatureexcept the signature is read from a file. Signature, but file-sourced. π--base=<committish>β see theBASE TREE INFORMATIONsection ofgit-format-patch(1). Base tree info is over there, bestie. π³--progressβ show progress reports on stderr as patches are generated. Progress bar energy. π--interdiff=<rev>β as a reviewer aid, insert an interdiff into the cover letter, or as commentary of the lone patch of a 1-patch series, showing the differences between the previous version of the patch series and the series currently being formatted.<rev>is a single revision naming the tip of the previous series which shares a common base with the series being formatted (for examplegit format-patch --cover-letter --interdiff=feature/v1 -3 feature/v2). Reviewer aid, but make it interdiff. π--range-diff=<refspec>β as a reviewer aid, insert a range-diff (seegit-range-diff(1)) into the cover letter, or as commentary of the lone patch of a single-patch series, showing the differences between the previous version of the patch series and the series currently being formatted.<refspec>can be a single revision naming the tip of the previous series if it shares a common base with the series being formatted (for examplegit format-patch --cover-letter --range-diff=feature/v1 -3 feature/v2), or a revision range if the two versions of the series are disjoint (for examplegit format-patch --cover-letter --range-diff=feature/v1~3..feature/v1 -3 feature/v2). Range-diff into the cover letter? Reviewer bestie behavior. π
β¨ Note: diff options you pass to the command affect how the primary product of format-patch is generated β and they are not passed along to the underlying range-diff machinery that builds the cover-letter material. (This may change in the future. π)
--creation-factor=<n>β used together with--range-diff, this tweaks the heuristic that matches up commits between the previous series of patches and the current one, by adjusting the creation/deletion cost fudge factor. Peepgit-range-diff(1))for the deets.
π¦ SEND OPTIONS π¦
-b <branch>,--branch=<branch>β use <branch> instead of the current branch, bestie.-a,--allβ send all applied patches. all of them. every last one. π-G <option>,--git-opt=<option>β pass an additional <option> straight through togit send-email. Check thegit-send-email(1)man page for what's on offer. You can specify this one multiple times β stack 'em up. π--from=<address>β sets the sender of the emails. If you don't say it on the command line, the value of thesendemail.fromconfiguration option is used instead. And if neither the command-line option norsendemail.fromis set? Then you get prompted for it. The default for that prompt is the value ofGIT_AUTHOR_IDENT, orGIT_COMMITTER_IDENTif that one isn't set, as returned bygit var -l. β¨--to=<address>β the primary recipient of the emails being generated. Generally this is the upstream maintainer of the project involved. Default is the value of thesendemail.toconfiguration value; if that's unspecified, and--to-cmdisn't specified either, you'll be prompted for it. This option may be specified multiple times. π«Ά--cc=<address>β gives each email a starting"Cc:"value. Default is the value ofsendemail.cc. May be specified multiple times. π--bcc=<address>β gives each email a starting"Bcc:"value. Default is the value ofsendemail.bcc. May be specified multiple times. π--subject=<subject>β sets the initial subject of the email thread. Only necessary if--composeis also set. If--composeisn't set, you'll be prompted for it.--reply-to=<address>β the address where replies from recipients should go to. Use this when replies to messages should land somewhere other than what's specified with the--fromparameter. π―--in-reply-to=<id>β makes the first mail (or all the mails with--no-thread) show up as a reply to the givenMessage-ID, which avoids breaking threads when you're providing a new patch series. The second and subsequent emails get sent as replies according to the--[no-]chain-reply-tosetting.
So for example, when --thread and --no-chain-reply-to are specified, the second and subsequent patches will be replies to the first one β like in the illustration below, where [PATCH v2 0/3] is in reply to [PATCH 0/2]:
[PATCH 0/2] Here is what I did...
[PATCH 1/2] Clean up and tests
[PATCH 2/2] Implementation
[PATCH v2 0/3] Here is a reroll
[PATCH v2 1/3] Clean up
[PATCH v2 2/3] New tests
[PATCH v2 3/3] Implementation
Only necessary if --compose is also set. If --compose isn't set, you'll be prompted for it. π§΅
--composeβ invokes a text editor (seeGIT_EDITORingit-var(1)) so you can edit an introductory message for the patch series.
When --compose is used, git send-email will use the From, Subject, and In-Reply-To headers specified in the message. If the body of the message (that's what you type after the headers and a blank line) only contains blank lines β or lines prefixed with Git: β then the summary will not be sent, but the From, Subject, and In-Reply-To headers will still be used, unless you remove them.
Missing From or In-Reply-To headers will be prompted for. π
See the CONFIGURATION section of git-send-email(1) for sendemail.multiEdit.
--annotateβ review and edit each patch you're about to send. Default is the value ofsendemail.annotate. βοΈ--identity=<id>β a configuration identity. When given, it causes values in thesendemail.<identity>subsection to take precedence over values in thesendemailsection. The default identity is the value ofsendemail.identity. π--no-threadβ if threading is enabled, theIn-Reply-ToandReferencesheaders get added to each email sent. Whether each mail refers to the previous email (deep threading, pergit format-patchwording) or to the first email (shallow threading) is governed by--[no-]chain-reply-to.
If disabled with --no-thread, those headers will not be added (unless specified with --in-reply-to). Default is the value of the sendemail.thread configuration value; if that's unspecified, it defaults to --thread.
β οΈ It is up to you, the user, to make sure that noIn-Reply-Toheader already exists whengit send-emailis asked to add one (especially note thatgit format-patchcan be configured to do the threading itself). Failing to do this may not produce the expected result in the recipient's MUA. fr fr, be careful. π
--confirm=<mode>β confirm right before sending. Default is the value of thesendemail.confirmconfiguration value; if that's unspecified, it defaults toautoβ unless any of the suppress options have been specified, in which case it defaults tocompose.
Confirmation modes, bestie:
alwaysβ will always confirm before sendingneverβ will never confirm before sendingccβ will confirm before sending whensend-emailhas automatically added addresses from the patch to theCclistcomposeβ will confirm before sending the first message when using--composeautoβ equivalent tocc+compose
--quietβ makesgit-send-emailless verbose. One line per email should be all that's output. shhh. π€«--dry-runβ does everything except actually send the emails. practice mode. π--dump-aliasesβ dumps configured aliases and exits.-n,--numberedβ use[PATCH n/m]even with a single patch.-N,--no-numberedβ use[PATCH]even with multiple patches.--start-number=<n>β start numbering at <n> instead of1. π’-v <n>,--reroll-count=<n>β marks the series as the *<n>*th reroll.--rfcβ use[RFC PATCH]instead of[PATCH].--subject-prefix=<prefix>β use[<prefix>]instead of[PATCH]. β¨
π STGIT π
Part of the StGit suite β see stg(1). π«Ά
okay that's literally the whole page, bestie, you ate that. this icon was brought to you by StGit 2.7.0, dated 10/17/2026, and it's STG-EMAIL(1) β go forth and send some patches, mwah ππΈ
π¦ 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