HG(REMOVE)
π NAME π
okay so bestie, hg remove β it removes the files you point at, on the next commit. that's the whole vibe. it's giving "schedule the cleanup, do the cleanup later." π§Ήβ¨
β¨ SYNOPSIS β¨
hg remove [OPTION]... FILE...
π¦ DESCRIPTION π¦
So what this actually does is schedule the files you name for removal from the current branch. Nothing gets committed yet β you're just putting it on the calendar. π
It queues those files to be gone at the next commit. Wanna undo a remove before that commit happens? Go see hg revert, she'll fix you right up. Wanna undo files you added? That's hg forget's job, not this one. π«Ά
Now here's the tea on the flags, because they change everything:
-A/--afteris for removing only files that are already deleted on disk. like, "yeah girl, I know she's gone, just record it."-f/--forceforces the deletion. no thoughts, just vibes.-Af(yes, together) removes files from the next revision without deleting them off your working directory. they leave the branch but stay on your disk. iconic behavior honestly. π
π the big table of what happens π
The following table details the behavior of remove for different file states (columns) and option combinations (rows). The file states are Added [A], Clean [C], Modified [M] and Missing [!] (as reported by hg status). The actions are Warn, Remove (from branch) and Delete (from disk):
βββββββββββββ¬ββββ¬βββββ¬βββββ¬ββββ
β opt/state β A β C β M β ! β
βββββββββββββΌββββΌβββββΌβββββΌββββ€
β none β W β RD β W β R β
βββββββββββββΌββββΌβββββΌβββββΌββββ€
β -f β R β RD β RD β R β
βββββββββββββΌββββΌβββββΌβββββΌββββ€
β -A β W β W β W β R β
βββββββββββββΌββββΌβββββΌβββββΌββββ€
β -Af β R β R β R β R β
βββββββββββββ΄ββββ΄βββββ΄βββββ΄ββββ
β οΈ Note βhg removenever deletes files in Added [A] state from the working directory. Not even if--forceis specified. Not even then. She said no. π βοΈ
Returns 0 on success, 1 if any warnings were encountered. so if you see a 1, something was side-eyeing you. π
π OPTIONS π
-A,--afterβ record delete for missing files (only the ones already ghosted π»)-f,--forceβ forget added files, delete modified files (brute force era πͺ)-S,--subreposβ recurse into subrepositories (we goin deep π³οΈ)-I,--include <PATTERN[+]>β include names matching the given patterns-X,--exclude <PATTERN[+]>β exclude names matching the given patterns-n,--dry-runβ do not perform actions, just print output (window shopping only, bestie ποΈ)
[+] marked option can be specified multiple times β stack 'em, she can take it π
πΈ ALIASES πΈ
rm β yeah you can just type that, it's the same thing, iykyk π
and that's the whole page, bestie!! this was hg remove from the HG(REMOVE) manual β same name up top, same name at the bottom, we love a full-circle moment. stay scheduled, stay slayed. π¦πβ¨
π¦ 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