HG(RESOLVE)
π hg resolve π
okay bestie, welcome to the hg resolve page from the HG(RESOLVE) manual β yes that's the whole header, it's giving mysterious, we move. this one's all about redoing merges and setting or viewing the merge status of files, and honestly? it's the glow-up your messy merge has been waiting for. π¦
β¨ NAME β¨
hg resolve β redo merges or set/view the merge status of files. periodt. π
πΈ SYNOPSIS πΈ
hg resolve [OPTION]... [FILE]...
π DESCRIPTION π
so, merges with unresolved conflicts? super often they're the leftovers of a non-interactive merge β like when you're using the internal:merge configuration setting, or some command-line merge tool like diff3. and that's exactly where hg resolve comes in, bestie: it's the command you use to manage all the files caught up in a merge, after hg merge has run and before hg commit runs. (translation: your working directory has to have two parents, no exceptions.) if you wanna know how to configure your merge tools, go read hg help merge-tools. π
here's every single way you can use hg resolve, no gatekeeping:
hg resolve [--re-merge] [--tool TOOL] FILE...: this one tries to re-merge the files you name, and it just straight-up discards any previous merge attempts like they never happened. (iconic behavior honestly.) but heads up β re-merging does not happen for files that are already marked as resolved. wanna select all the unresolved files instead? that's--all/-a, easy. and--toollets you pick the merge tool used for those files β it overrides theHGMERGEenvironment variable and your configuration files, so it wins, no cap. also your previous file contents get saved with a.origsuffix, so nothing's truly gone. π«Άhg resolve -m [FILE]: marks a file as having been resolved β perfect for when you already fixed stuff up by hand. and if you don't name any files, the default is to mark all unresolved files. β¨hg resolve -u [FILE]...: marks a file as unresolved. and again, no files named means the default kicks in β this time it marks all resolved files. π₯hg resolve -l: lists the files that had conflicts or still have them. in the printed list,U= unresolved andR= resolved. you can filter that list withset:unresolved()orset:resolved()β details live inhg help filesets. π
Note π¨ Mercurial will not let you commit files with unresolved merge conflicts. like, at all. you must run hg resolve -m ... before you can commit after a conflicting merge. that's not a suggestion, that's the law. π
π Template π
besides the common template keywords and functions, these keywords are supported too β also peep hg help templates for more:
mergestatusβ String. the character denoting merge conflicts,UorR. βpathβ String. the repository-absolute path of the file.
Returns 0 on success, 1 if any files fail a resolve attempt. (yes, that's the exit status, and yes, you should care about it.) π
π OPTIONS π
-a,--allβ select all unresolved files-l,--listβ list state of files needing merge-m,--markβ mark files as resolved-u,--unmarkβ mark files as unresolved-n,--no-statusβ hide status prefix--re-mergeβ re-merge files-t,--tool <TOOL>β specify merge tool-I,--include <PATTERN[+]>β include names matching the given patterns-X,--exclude <PATTERN[+]>β exclude names matching the given patterns-T,--template <TEMPLATE>β display with template
[+] marked option can be specified multiple times π§
and that's the whole page, bestie β that footer line down there just says HG(RESOLVE) again, which is the manual source and version, and there's no date attached, so consider this your official cute sign-off: go resolve those conflicts, you absolute 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