HG(UPDATE)

πŸ‘‘ hg update β€” the glow-up your working directory deserves πŸ’…

okay so bestie, welcome to HG(UPDATE), aka the manual page for hg update β€” updating your working directory (or, like, switching revisions if that's the vibe you're on today). no cap, this is the command you run when you want your files to match a different changeset, and it is iconic once you get it. let's go. ✨


✨ SYNOPSIS ✨

hg update [-C|-c|-m] [-d DATE] [[-r] REV]

that's it, that's the whole mood. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

So what does it do. It updates the repository's working directory to the specified changeset. If you don't specify a changeset, it updates to the tip of the current named branch and moves the active bookmark (peep hg help bookmarks for the tea on bookmarks πŸ’–).

Update sets the working directory's parent revision to the specified changeset β€” yes, hg help parents has the lore on that one.

Now here's the part where it gets real. If the changeset is not a descendant or ancestor of the working directory's parent, and there are uncommitted changes, the update is aborted. no update for you, bestie. but with the -c/--check option, the working directory gets checked for uncommitted changes, and if none are found, the working directory is updated to the specified changeset. slay.

The -C/--clean, -c/--check, and -m/--merge options control what happens if the working directory contains uncommitted changes. And at most of one of them can be specified β€” pick one, girl, you can't have all three. πŸ’…

  1. No option specified β€” if the requested changeset is an ancestor or descendant of the working directory's parent, the uncommitted changes are merged into the requested changeset and the merged result is left uncommitted. If the requested changeset is not an ancestor or descendant (that is, it is on another branch), the update is aborted and the uncommitted changes are preserved. phew.
  2. With the -m/--merge option β€” the update is allowed even if the requested changeset is not an ancestor or descendant of the working directory's parent. bold. brave. main character energy. πŸ”₯
  3. With the -c/--check option β€” the update is aborted and the uncommitted changes are preserved. protecting your work, as she should.
  4. With the -C/--clean option β€” uncommitted changes are discarded and the working directory is updated to the requested changeset. gone. deleted. never to be seen again. 😭
To cancel an uncommitted merge (and lose your changes), use hg merge --abort. yes you will lose your changes, that's literally the point, so be sure bestie. πŸ’€
Use null as the changeset to remove the working directory (like hg clone -U). she's empty, she's clean, she's new. 🧚

If you want to revert just one file to an older revision, use hg revert [-r REV] NAME β€” one file, not the whole directory, iykyk. πŸ“

See hg help dates for a list of formats valid for -d/--date. yes there are many. yes they are all valid. go off. πŸ“…

Returns 0 on success, 1 if there are unresolved files. (that 1? that's your sign to go fix stuff fr fr.) 🌈


πŸ’– OPTIONS πŸ’–

  • -C, --clean β€” discard uncommitted changes (no backup). no backup. none. this is the scary one, treat her with respect. πŸ™ˆ
  • -c, --check β€” require clean working directory. she's gotta be spotless before we proceed. ✨
  • -m, --merge β€” merge uncommitted changes. we're making it work, we're blending the vibes. 🌸
  • -d, --date <DATE> β€” tipmost revision matching date. give her a date and she'll find the tipmost revision matching it. πŸ’œ
  • -r, --rev <REV> β€” revision. the actual revision you're updating to. the whole point, honestly. ⭐
  • -t, --tool <TOOL> β€” specify merge tool. you pick the tool, she uses the tool. πŸŽ€

🌟 ALIASES 🌟

  • up
  • checkout
  • co

three names, one legend. πŸ‘‘


and that's the page, bestie!! 🫢 this was HG(UPDATE) β€” go forth and update responsibly, back up your uncommitted changes, and remember: -C does not care about your feelings. mwah. πŸ’–βœ¨πŸŽ€