HG(ADD)
π hg add β the "okay bestie, let's get you tracked" command π
HG(ADD) is the page, hg add is the vibe. It lives in the Mercurial manual set, and it's literally the cutest little onboarding ritual: you've got files, the repo doesn't know about them yet, and you're about to fix that.
β¨ SYNOPSIS β¨
hg add [OPTION]... [FILE]...
π¦ DESCRIPTION π¦
Schedule files to be version controlled and added to the repository.
That's it, that's the whole job. The files will be added to the repository at the next commit β so nothing is actually in there yet, it's more like a pinky promise to the repo. And if you change your mind before that commit happens? No worries babe, see hg forget. Undo era. π
If no names are given, add all files to the repository (except files matching .hgignore). Every single one. It's giving "yes to everything" energy and honestly, sometimes that's the move.
πΈ Examples πΈ
- New (unknown) files are added automatically by
hg add:
$ ls
foo.c
$ hg status
? foo.c
$ hg add
adding foo.c
$ hg status
A foo.c
Not the ? turning into an A π that's the character development arc fr fr.
- Specific files to be added can be specified:
$ ls
bar.c foo.c
$ hg status
? bar.c
? foo.c
$ hg add bar.c
$ hg status
A bar.c
? foo.c
Returns 0 if all files are successfully added. Zero means slay. Zero means we ate. π
π OPTIONS π
-I,--include <PATTERN[+]>β include names matching the given patterns. Only the chosen ones get in, gatekeeping but make it fashion.-X,--exclude <PATTERN[+]>β exclude names matching the given patterns. Not you, not you, absolutely not you.-S,--subreposβ recurse into subrepositories. Yes bestie, we're going deeper. π-n,--dry-runβ do not perform actions, just print output. A little dress rehearsal, no commitment, zero consequences. Iconic behaviour honestly.
[+] marked option can be specified multiple times β so if you need -I four times, that's valid, that's allowed, live your truth. β¨
Anyway, this whole page comes from the hg manual set β the footer's just HG(ADD), no extra version drama or date attached, so that's all the metadata we've got, bestie. Go add those files, you main character. π«ΆπΈπ
π¦ 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