STG-NEW(1)
πΈ stg-new β bestie edition π
okay so this is stg-new(1) from the StGit Manual, and it's literally the glow-up command for your patch stack. new patch, top of the stack, main character energy. let's get into it π
β¨ NAME β¨
stg-new β create a new patch at the top of the stack π«Ά
π SYNOPSIS π
stg new [OPTIONS] [patchname] [-- <path>...]
stg new [OPTIONS] [--name <patchname>] [-- <path>...]
two ways to say it, same vibe, no cap β¨
π DESCRIPTION π
Okay so what this does is create a new, empty patch on the current stack. the new patch gets created on top of the currently applied patches, and it's made the new top of the stack. like, it gets promoted to top of the group chat, instantly π
big thing though β uncommitted changes in the work tree are not included in the patch. that's stg-refresh's job, not this one's, so don't come for this command about it π
the given patch name has to be unique in the stack, fr fr, no duplicates allowed. if you don't give a name, one gets generated from the first line of the patch's commit message. automatic slay.
patch names follow the rules for Git references, with the extra constraint that patch names may not contain the / character. if you need details, see git-check-ref-format(1). π¦
patch names may start with a leading -. when you're specifying one of those on the command line, you can escape the leading - with a single backslash, like \-patch-name, so the command doesn't get confused between your patch name and an option. iykyk β¨
an editor will launch so you can edit the commit message that'll be used for the patch β unless the --message flag already specified one, in which case you're done, periodt. the patchdescr.tmpl template file (if it's available) is used to pre-fill the editor. β¨
π OPTIONS π
-n<name>,--name=<name>β alternative to the[patchname]argument for specifying the name of the new patch. this option lets the patch name start with an unescaped leading-π-r,--refreshβ refresh the new patch with changes from the work tree. new patches are empty by default, but with this option the new patch captures outstanding changes in the work tree, as ifstg-refresh(1)was run. use--indexto refresh from the index instead of the work tree. π«Ά-i,--indexβ instead of refreshing the patch with the current contents of the worktree, use the current contents of the index. swap the source, still slay π-F,--forceβ force refresh with staged and unstaged changes.
by default, if there are staged changes in the index along with unstaged changes in the work tree, the command will abort. this option forces the command to proceed using both the staged and unstaged changes. drama avoided (or caused, depending on your intentions) π
--submodulesβ include submodules in patch content π§--no-submodulesβ exclude submodules in patch content π§-e,--editβ invoke editor for patch description βοΈ-d,--diffβ show diff when editing patch description-m<message>,--message=<message>β use message instead of invoking the editor. skip the whole editor moment, just say it πΈ-f<path>,--file=<path>β use the contents of file instead of invoking the editor. use-to read from stdin. π--no-verifyβ disable commit-msg hook-s[=<value>],--signoff[=<value>]β addSigned-off-bymessage trailer.
the value is optional and defaults to the committer name and email. this option may be provided multiple times. pile 'em up π
--ack[=<value>]β addAcked-bymessage trailer.
the value is optional and defaults to the committer's name and email. this option may be provided multiple times. β¨
--review[=<value>]β addReviewed-bymessage trailer.
the value is optional and defaults to the committer's name and email. this option may be provided multiple times. β¨
--author=<name-and-email>β set the author"name <email>"--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. β°
--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. matching timestamps, cute π₯--save-template=<file>β instead of running the command, just write the patch description to FILE, and exit. (if FILE is-, write to stdout.) π«Ά
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. big brain workflow, ngl π§ β¨
π STGIT π
part of the StGit suite β see stg(1) π
and that's the whole thing, bestie π this page is StGit 2.7.0, dated 10/17/2026, and honestly? iconic. go make some patches, you're literally the main character of this stack ππ
π¦ 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