HG(MERGE)
π hg merge β bestie edition π
okay so you're in the HG(MERGE) part of the manual, which is the β¨mergeβ¨ page, and honestly? it's giving "we're combining two timelines and one of them is your working directory" π¦
πΈ NAME πΈ
hg merge β merge another revision into working directory. yes literally that's it, that's the whole job π«Ά
β¨ SYNOPSIS β¨
hg merge [-P] [[-r] REV]
π DESCRIPTION π
okay so the tea: your current working directory gets updated with all the changes that were made in the revision you asked for, since the last common predecessor revision. that's the vibe. that's what a merge IS π₯
Files that changed between either parent get marked as changed for the next commit, and here's the part that matters β a commit MUST be performed before any further updates to the repository are allowed. no skipping, no sneaking around it, periodt π and the next commit is gonna have two parents. iconic polyamory tbh π
--tool can be used to specify the merge tool used for file merges. it overrides the HGMERGE environment variable and your configuration files β it's the main character, it wins every argument. see hg help merge-tools for options.
so like, when do you not have to type a revision? if no revision is specified, AND the working directory's parent is a head revision, AND the current branch contains exactly one other head β then the other head is merged with by default. cute. otherwise? you gotta provide an explicit revision to merge with, no guessing π
See hg help resolve for information on handling file conflicts. (you will have conflicts. it's fine. it's normal. breathe π§)
To undo an uncommitted merge, use hg merge --abort which will check out a clean copy of the original merge parent, losing all changes. like. GONE gone. so know that before you type it bestie π
Returns 0 on success, 1 if there are unresolved files. that's the whole mood board π
π OPTIONS π
-f,--forceβ force a merge including outstanding changes. β οΈ this one is DEPRECATED, so like, it's still here but it's giving "we don't really talk about her anymore" π-r,--rev <REV>β revision to merge. the one you're pulling into your life β¨-P,--previewβ review revisions to merge, and no merge is performed. window shopping only, zero commitment ποΈ--abortβ abort the ongoing merge. the "jk lol nevermind" button π-t,--tool <TOOL>β specify merge tool. you're picking who handles the drama π
ngl the-f/--forcedeprecation is real and you should not be building your workflow on it, no cap.
π SEE ALSO π
hg help merge-toolshg help resolve
and that's the page!! this was the HG(MERGE) manual page from the Mercurial docs, dated with the footer HG(MERGE) β so like, if you cite it, that's the source and the date, that's the whole receipt π go merge something, you've got this, 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