HG(COMMIT)
π HG(COMMIT) π
okay bestie, welcome to hg commit β literally one of the most iconic Mercurial pages in the whole manual, no cap. it's giving "save your work, queen" energy. β¨
πΈ NAME πΈ
hg commit β commit the specified files or all outstanding changes π«Ά
β¨ SYNOPSIS β¨
hg commit [OPTION]... [FILE]...
π¦ DESCRIPTION π¦
So what you're doing here is committing changes to the given files into the repository. And here's the tea: unlike a centralized SCM, this operation is a local operation. like, it happens on your machine, by yourself, main character energy. if you want a way to actively distribute your changes, go see hg push. π
If you just... don't give it a list of files? Then all the changes reported by hg status get committed. all of them. the whole vibe. π
If you are committing the result of a merge, do not provide any filenames or -I/-X filters. like, just don't, okay? that's the rule. π
If no commit message is specified, Mercurial starts your configured editor where you can enter a message. and if your commit fails (crying), you will find a backup of your message in .hg/last-message.txt. so your words are safe, bestie, breathe. π
The --close-branch flag can be used to mark the current branch head closed. When all heads of a branch are closed, the branch will be considered closed and no longer listed. periodt. π
The --amend flag can be used to amend the parent of the working directory with a new commit that contains the changes in the parent in addition to those currently reported by hg status, if there are any. The old commit is stored in a backup bundle in .hg/strip-backup (see hg help bundle and hg help unbundle on how to restore it). iconic, honestly. β
Message, user and date are taken from the amended commit unless specified. When a message isn't specified on the command line, the editor will open with the message of the amended commit. convenient much? π§
big caveat time: it is not possible to amend public changesets (see hg help phases) or changesets that have children. like, it will not work. don't try it. π
See hg help dates for a list of formats valid for -d/--date. ποΈ
Returns 0 on success, 1 if nothing changed. π
Examples:
- commit all files ending in
.py:
hg commit --include "set:**.py"
- commit all non-binary files:
hg commit --exclude "set:binary()"
- amend the current commit and set the date to now:
hg commit --amend --date now
π OPTIONS π
-A,--addremoveβ mark new/missing files as added/removed before committing π--close-branchβ mark a branch head as closed π--amendβ amend the parent of the working directory β¨-s,--secretβ use the secret phase for committing π€«--draftβ use the draft phase for committing π-e,--editβ invoke editor on commit messages βοΈ--force-close-branchβ forcibly close branch from a non-head changeset (ADVANCED) π₯-i,--interactiveβ use interactive mode πΉοΈ-I,--include<PATTERN[+]> β include names matching the given patterns π-X,--exclude<PATTERN[+]> β exclude names matching the given patterns π-m,--message<TEXT> β use text as commit message π¬-l,--logfile<FILE> β read commit message from file π-d,--date<DATE> β record the specified date as commit date π-u,--user<USER> β record the specified user as committer π«Ά-S,--subreposβ recurse into subrepositories πͺ
the [+] marked option can be specified multiple times β go off, stack them, whatever, live your truth. π
π ALIASES π
ci
and that's the whole page, bestie!! π this was HG(COMMIT) from the HG(COMMIT) manual β same title top and bottom, cute little sandwich β so consider this your sign-off: HG(COMMIT), the commit page, that's the one πβ¨ go commit something and slay. π¦πΈ
π¦ 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