STG-REFRESH(1)
π stg-refresh β the StGit manual, bestie edition β¨
Okay so real talk: this is stg-refresh from the StGit manual, and it's about to become your new favorite command. Buckle up π
πΈ NAME πΈ
stg-refresh β the icon that scoops up all your worktree changes and tucks them into the current patch π
β¨ SYNOPSIS β¨
stg refresh [OPTIONS] [path]...
π DESCRIPTION π
So here's the vibe: stg refresh takes the latest work tree and index changes and folds them into the current patch. It literally generates a brand new git commit object for that patch β meaning the old commit? Gone. Not visible anymore. Poof π¨ (so like, don't come looking for it).
Now, the important part, bestie, listen up π: refresh will warn you if the index is dirty, and it will require you to use either the --index or --force options to override that check. Why? Because it's protecting you π«Ά β it doesn't want you accidentally doing a full refresh when you only staged some of your changes using git add interactive mode. That would be a mess and nobody wants that.
You can optionally list one or more files or directories relative to the current working directory β and if you do, only the matching files get updated. Slay, selective π¦
Behind the scenes (iykyk), stg refresh first creates a new temporary patch with all your updates, then merges that temp patch into the patch you asked to refresh. And here's the tea β: if you asked to refresh a patch that isn't the topmost patch, there can be conflicts. In that case, the temporary patch gets left behind for you to deal with β for example with stg squash. Not me leaving you a little homework π
Also, the creation of that temporary patch gets recorded in a separate entry in the patch stack log. Which means: one undo step undoes the merge between the other patch and the temp patch, and two undo steps additionally gets rid of the temp patch entirely. Two-for-one undo realness β¨
π₯ OPTIONS π₯
-u,--updateβ only update the current patch files. Just the current ones. That's it π-i,--indexβ instead of setting the patch top to the current contents of the worktree, set it to the current contents of the index. Different source, same energy π-F,--forceβ instead of warning you when some work has already been staged (like withgit addinteractive mode), just force a full refresh. Warning? Skipped. Sent to voicemail π΅--conflicts[=<policy>]β either"allow"or"disallow"pushing a patch with conflicts.
Using --conflicts=allow (or just plain --conflicts) allows pushing a patch that may result in unresolved merge conflicts. The patch will be pushed and files with conflicts will be left with conflict markers for you to resolve manually π β or you can undo the whole operation with stg undo --hard. This is the default behavior, and it also corresponds to the "stgit.push.allow-conflicts" variable being set to "true".
Using --conflicts=disallow disallows pushing any patch that would result in merge conflicts. The operation will stop on the last patch that can be pushed without conflicts. You can configure this behavior by setting "stgit.push.allow-conflicts" to "false".
-p <patch>,--patch=<patch>β refresh (applied)<patch>instead of the top patch. Mixing it up, love that π-a <note>,--annotate=<note>β annotate the patch log entry with<note>π--submodulesβ include submodules in patch content π§--no-submodulesβ exclude submodules in patch content π§ββοΈ (the opposite one)-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 editor, deliver the words π¬-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>]β 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 π₯
--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.
--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.
--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. Live in the moment β°
--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. Time travel, but make it git π°οΈ
Heads up bestie: refresh warns on a dirty index and makes you pass--indexor--forceto get past it. And if you refresh a non-topmost patch, conflicts can happen and the temp patch stays behind for you. That's canon, not a glitch π
π«Ά STGIT π«Ά
Part of the StGit suite β see stg(1) π
That's the whole page, no cap. Brought to you by StGit 2.7.0, dated 10/17/2026 β go forth and refresh, you absolute main character ππ
π¦ 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