STG-EDIT(1)
π stg-edit β the manual page, but make it cute
Okay bestie, welcome to STG-EDIT(1) from the StGit Manual β yes that's the whole title, we're fancy here. This is the page where you learn how to β¨edit a patchβ¨ and honestly it's giving main character energy.
πΈ SYNOPSIS πΈ
stg edit [OPTIONS] [patch]
That's it. That's the whole vibe. Options, an optional patch, slay.
π DESCRIPTION π
Bestie, listen: this command edits a patch. And when I say edits, I mean you can touch so many aspects of it β the message, the author, the patch name, or even the patch's diff itself. Literally the whole glow-up. π
By default, the topmost patch is what gets edited. Iconic behavior, no notes.
Now, here's the tea: with no options, or when --edit is specified, the patch details get edited interactively. Alternatively β and this is the lowkey efficient route β command line options can be used to modify the patch non-interactively. Pick your fighter. π«Ά
And then there's --diff, which causes the patch's diff to be appended to the patch description when you're editing interactively. That diff may be edited interactively (or you can just use it as a reference while you're editing the patch's message, ngl that's valid). The StGit then attempts to apply the modified diff to the patch's parent tree. β
β οΈ Important caveat, pay attention bestie: if the updated diff does not apply, no changes are made to the patch at all β and the edited patch gets saved to a file. That file can be corrected and then fed back into stg edit --file. So like, not the end of the world, but do note it. π
β¨ OPTIONS β¨
-e,--editβ Invoke editor for patch description. Classic. The original way. π-d,--diffβ Show diff when editing patch description. See the whole picture, queen.-m <message>,--message=<message>β Use message instead of invoking the editor. Type it once, done, periodt.-f <path>,--file=<path>β Use the contents of file instead of invoking the editor. And here's the cute part: use"-"to read from stdin. π--no-verifyβ Disable commit-msg hook. No gatekeeping today.-s[=<value>],--signoff[=<value>]β Add"Signed-off-by"message trailer.
The value is optional and defaults to the committer name and email. This option may be provided multiple times. Stack 'em up, bestie. π¦
--ack[=<value>]β Add"Acked-by"message trailer.
The value is optional and defaults to the committer's name and email. This option may be provided multiple times. Very demure, very acknowledged.
--review[=<value>]β Add"Reviewed-by"message trailer.
The value is optional and defaults to the committer's name and email. This option may be provided multiple times. Reviewed and approved, iykyk. β
--author=<name-and-email>β Set the author"name <email>". Give credit where it's due. π--authname=<name>β Set the author name.--authemail=<email>β Set the author email.--authdate=<date>β Set the date the patch was authored.
Use "now" to use the current time and date. Time travel but make it timestamps. β°
--committer-date-is-author-dateβ Instead of using the current time as the committer date, use the author date of the commit as the committer date. Matchy-matchy, we love to see it. πΈ--save-template=<file>β Instead of running the command, just write the patch description to FILE, and exit. (If FILE is"-", write to stdout.)
Lowkey the most useful thing ever when driving StGit from another program: it may be useful to first call a command with --save-template, then let the user edit the message, and then call the same command with --file. A whole little pipeline, adorable. π§
-t <treeish>,--set-tree=<treeish>β Set the patch's git tree to the specified treeish without changing the tree of any other patches. When used on the top patch, the index and work tree will be updated to match the new tree.
Heads up bestie, this is a low-level option, primarily meant to be used by tools built on top of StGit β such as the Emacs mode. See also the --set-tree flag of stg-push(1). π₯
π STGIT π
Part of the StGit suite β see stg(1). You're part of a family, bestie. π«Ά
Okay that's the whole page, mwah π β this was StGit 2.7.0, dated 10/17/2026. Go edit some patches and be iconic. πβ¨π
π¦ 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