STG-IMPORT(1)

✨ STG-IMPORT πŸ’…

okay so bestie, welcome to stg-import from the StGit Manual β€” this is the one that slides patches into your stack, and honestly? it's giving main character energy πŸŽ€


🌸 NAME 🌸

stg-import β€” import patches to stack πŸ¦‹


✨ SYNOPSIS ✨

like, here's all the ways you can run it, no cap:

stg import [OPTIONS] <diff-path>
stg import [OPTIONS] -m [<mail-path>|<Maildir-path>]
stg import [OPTIONS] -M [<mbox-path>]
stg import [OPTIONS] -S [<series-path>]
stg import [OPTIONS] -u <diff-url>
stg import [OPTIONS] -u -m <mail-url>
stg import [OPTIONS] -u -M <mbox-url>
stg import [OPTIONS] -u -S <series-url>

πŸ’– DESCRIPTION πŸ’–

So the whole vibe here is: import patches from various sources to the stack. literally that's the job. 🌈

The simplest usage is to import a diff/patch file into the stack from a local file. By default, the file name is used as the patch name, but this can be overridden with --name. The patch can either be a normal file with the description at the top, or it can have standard mail format. The "Subject", "From", and "Date" headers will be used for the imported patch's author details. iykyk πŸ‘‘

Patches may also be imported from a mail file (-m/--mail), an mbox (-M/--mbox), or a series (-S/--series). Furthermore, the -u/--url option allows the patches source to be fetched from a url instead of from a local file. obsessed with the flexibility tbh ✨

⚠️ okay listen: if a patch does not apply cleanly, import is aborted unless --reject is specified, in which case it will apply to the work tree the parts of the patch that are applicable, leave the rejected hunks in corresponding *.rej files, and add an empty patch to the stack. so like, that's a whole situation πŸ’€

The patch description must be separated from the diff with a "---" line. fr fr, don't forget this one 🫢


πŸŽ€ OPTIONS πŸŽ€

  • -m, --mail β€” Import patch from an email file πŸ’Œ
  • -M, --mbox β€” Import patch series from an mbox file πŸ“¬
  • -S, --series β€” Import patch series from a series file are tar archive. (yes bestie, that's what it says πŸ“)
  • -u, --url β€” Retrieve source from a url instead of local file 🌐
  • -n <name>, --name=<name> β€” Use <name> as the patch name ✨
  • -p <n>, --strip=<n> β€” Remove <n> leading components from diff paths (default 1) βœ‚οΈ
  • --directory=<root> β€” Prepend <root> to all filenames. If a "-p" argument is also passed, it is applied before prepending the new root. πŸ—‚οΈ
  • -t, --stripname β€” Strip number and extension from patch name πŸ’…
  • -C <n> β€” Ensure <n> lines of matching context for each change πŸ”
  • -3, --3way β€” Attempt 3-way merge if the patch records the identity of blobs it is supposed to apply to and those blobs are available locally. 🧚
  • -i, --ignore β€” Ignore the applied patches in the series πŸ™ˆ
  • --replace β€” Replace the unapplied patches in the series πŸ”
  • -b <committish>, --base=<committish> β€” Use <committish> instead of HEAD for file importing 🌱
  • --reject β€” Leave rejected hunks in ".rej" files 😭
  • --keep-cr β€” Do not remove "\r" from email lines ending with "\r\n" πŸš—
  • --message-id β€” Create Message-ID trailer in patch description based on the Message-ID email header. This option is applicable when importing with --mail or --mbox. This behavior may also be enabled via the "stgit.import.message-id" configuration option. πŸ†”
  • -e, --edit β€” Invoke editor for patch description πŸ“
  • -d, --diff β€” Show diff when editing patch description πŸ‘€
  • --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.
  • --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.
  • --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. ⏰

πŸ‘‘ STGIT πŸ‘‘

Part of the StGit suite β€” see stg(1) πŸ’œ


mwah πŸ’‹ that's the whole page, bestie β€” brought to you by StGit 2.7.0, dated 10/17/2026. go forth and import, you absolute icon πŸ¦‹πŸŒΈβœ¨

πŸ“¦ where this page comes from