HG(UNSHELVE)

✨ HG(UNSHELVE) ✨

okay bestie, so you know how you shelved your whole entire vibe earlier and now you need it back?? that's this. hg unshelve is the unshelve command from the hg manual, and it's literally here to restore a shelved change to the working directory 🫢


🌸 SYNOPSIS 🌸

hg unshelve [OPTION]... [[-n] SHELVED]

πŸ’– DESCRIPTION πŸ’–

so basically this command takes an optional name of a shelved change to restore. no name? no problem. it just grabs the most recent shelved change instead. the way that it just knows which one you meant πŸ’…

if a shelved change gets applied successfully, the bundle that contains the shelved changes gets moved to a backup location: .hg/shelve-backup. iconic behavior, honestly.

now here's the part where we get a lil real. since you can restore a shelved change on top of an arbitrary commit, it's totally possible that unshelving will result in a conflict between your changes and the commits you're unshelving onto. it's giving messy. if that happens, you must resolve the conflict, and then use --continue to complete the unshelve operation. and bestie, listen β€” the bundle will not be moved until you successfully complete the unshelve. so don't go anywhere πŸ‘€

(alternatively, you can use --abort to abandon an unshelve that causes a conflict. this reverts the unshelved changes, and leaves the bundle in place. a lil escape hatch, we love her.)

oh and also β€” if a bare shelved change (that means without interactive, include and exclude option) was done on a newly created branch, it would restore branch information to the working directory. cute, right?

after a successful unshelve, the shelved changes are stored in a backup directory. only the N most recent backups are kept. N defaults to 10 but can be overridden using the shelve.maxbackups configuration option. yes, you can change it, go off ✨

timestamp in seconds is used to decide order of backups. more than maxbackups backups are kept, if same timestamp prevents from deciding exact order of them, for safety. safety first, always 🌈

selected changes can be unshelved with the --interactive flag. the working directory is updated with the selected changes, and only the unselected changes remain shelved. but β€” note: the whole shelve is applied to working directory first before running interactively. so this will bring up all the conflicts between working directory and the shelve, irrespective of which changes will be unshelved. yeah. all of them. no cap 😭


πŸŽ€ OPTIONS πŸŽ€

  • -a, --abort β€” abort an incomplete unshelve operation. peace out, we're not doing this today πŸ™ˆ
  • -c, --continue β€” continue an incomplete unshelve operation. pick up where you left off, queen πŸ‘‘
  • -i, --interactive β€” use interactive mode (EXPERIMENTAL). experimental besties, tread carefully πŸ’€
  • -k, --keep β€” keep shelve after unshelving. why not have both honestly πŸ’–
  • -n, --name <NAME> β€” restore shelved change with given name. call her by name, she'll come πŸ¦‹
  • -t, --tool <VALUE> β€” specify merge tool. for when the merge needs a lil professional help ✨
  • --date <DATE> β€” set date for temporary commits (DEPRECATED). old and busted, but she's still here πŸ₯²

fr fr, don't skip the conflict part. --continue and --abort are your besties in a crisis. periodt.

that's the whole page, babes. this was the <code>HG(UNSHELVE)</code> manual β€” hg's unshelve command, dated <strong>2024-09-02</strong>. k bye, go unshelve something πŸ’œβœ¨