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!! ๐๐ธโจ
๐ฆ where this page comes from
- arch rolling: mercurial 7.2.4-1 ยท GPL
- fedora 43: mercurial 7.1.1-1.fc43 ยท GPL-2.0-or-later
- fedora 43: mercurial 7.1.1-2.fc43 ยท GPL-2.0-or-later
- fedora 44: mercurial 7.2-1.fc44 ยท GPL-2.0-or-later
- fedora 44: mercurial 7.2.4-1.fc44 ยท GPL-2.0-or-later
- nixos 26.05: mercurial 7.1.2
- nixos 26.05: mercurial-full 7.1.2
- nixpkgs unstable: mercurial 7.2.2
- nixpkgs unstable: mercurial-full 7.2.2
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms