LinuxCommandLibrary

hg-update

updates the working directory to a specific revision

TLDR

Update to tip
$ hg update
copy
Update to specific revision
$ hg update -r [revision]
copy
Update to branch
$ hg update [branch-name]
copy
Update to tag
$ hg update [tag-name]
copy
Clean update discarding changes
$ hg update -C
copy
Check for uncommitted changes first
$ hg update -c [revision]
copy

SYNOPSIS

hg update [options] [rev]

DESCRIPTION

hg update (alias: up, checkout, co) updates the working directory to a specific revision. Without arguments, updates to the tip of the current branch. Can update to revisions, branches, tags, or bookmarks. Use -C to discard local changes or -c to abort if changes exist.

PARAMETERS

-r, --rev rev

Revision to update to.
-C, --clean
Discard uncommitted changes.
-c, --check
Abort if uncommitted changes exist.
-m, --merge
Merge uncommitted changes.

SEE ALSO

hg(1), hg-pull(1), hg-merge(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard