HG(SHELVE)

๐Ÿ’– hg shelve โ€” the Mercurial manual, but make it bestie ๐Ÿ’–

okay so this is the page for hg shelve from the Mercurial manual (the manual name is literally HG(SHELVE), she's giving very "my name is on both the top and the bottom of the page" main character energy and honestly? slay).


โœจ NAME โœจ

hg shelve โ€” save and set aside changes from the working directory ๐ŸŽ€


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

hg shelve [OPTION]... [FILE]...

๐ŸŒธ DESCRIPTION ๐ŸŒธ

so basically, shelving is the move where you take files that hg status is like "bestie these are NOT clean" about, save all those modifications into a bundle (that's your shelved change ๐Ÿ’…), and then revert the files so their state in the working directory becomes clean again. it's giving "clean up your room by shoving everything in the closet", but make it version control.

to restore those changes back into the working directory, you use hg unshelve. and here's the iconic part: this will work even if you switch to a different commit. the way that works is genuinely so powerful, no cap.

when you don't specify any files, hg shelve saves all the not-clean files. if you name specific files or directories, only the changes to those files get shelved. simple as that, periodt.

in bare shelve โ€” which means no files specified, and no interactive, include or exclude option โ€” shelving remembers info if the working directory was on a newly created branch. in other words, the working directory was on a different branch than its first parent. in that situation, unshelving restores the branch information to the working directory. ๐ŸŒˆ iykyk.

every shelved change has a name, so it's easier to find later. the name defaults to being based on the active bookmark โ€” or, if there's no active bookmark, the current named branch. wanna pick your own? use --name. ๐Ÿ’–

to see a list of existing shelved changes, use the --list option. for each shelved change it prints its name, age, and description. want more tea? use --patch or --stat for more details. ๐Ÿ‘‘

to delete specific shelved changes, use --delete. to delete all shelved changes, use --cleanup. (careful, bestie, that one is a full send ๐Ÿ’€)


๐Ÿ’… OPTIONS ๐Ÿ’…

  • -A, --addremove โ€” mark new/missing files as added/removed before shelving โœจ
  • -u, --unknown โ€” store unknown files in the shelve ๐Ÿ™ˆ
  • --cleanup โ€” delete all shelved changes ๐Ÿ’€ (yes ALL of them, she does not play)
  • --date <DATE> โ€” shelve with the specified commit date ๐Ÿ—“๏ธ
  • -d, --delete โ€” delete the named shelved change(s) ๐Ÿ—‘๏ธ
  • -e, --edit โ€” invoke editor on commit messages โœ๏ธ
  • -k, --keep โ€” shelve, but keep changes in the working directory ๐Ÿซถ (the "have your cake and eat it too" option, obsessed)
  • -l, --list โ€” list current shelves ๐Ÿ“‹
  • -m, --message <TEXT> โ€” use text as shelve message ๐Ÿ’ฌ
  • -n, --name <NAME> โ€” use the given name for the shelved commit ๐Ÿท๏ธ
  • -p, --patch โ€” output patches for changes (provide the names of the shelved changes as positional arguments) ๐Ÿฉน
  • -i, --interactive โ€” interactive mode ๐ŸŽฎ
  • --stat โ€” output diffstat-style summary of changes (provide the names of the shelved changes as positional arguments) ๐Ÿ“Š
  • -I, --include <PATTERN[+]> โ€” include names matching the given patterns โœ…
  • -X, --exclude <PATTERN[+]> โ€” exclude names matching the given patterns โŒ
[+] marked option can be specified multiple times ๐Ÿ”

and that's the whole page, bestie!! ๐Ÿซถ every last flag accounted for, nothing skipped, we ate and left no crumbs. this one is signed off by none other than HG(SHELVE) โ€” yes, the same name that opened the page, she's closing it too because she's consistent like that ๐Ÿ‘‘ โ€” dated HG(SHELVE). iconic from start to finish. bye!! ๐Ÿ’œ๐ŸŒธโœจ