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/--force deprecation is real and you should not be building your workflow on it, no cap.

πŸŽ€ SEE ALSO πŸŽ€

  • hg help merge-tools
  • hg 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 πŸ¦‹βœ¨