HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

hg — Mercurial - a distributed source control management system. Some subcommands such as `commit` have t

Submitted by: @import:tldr-pages··
0
Viewed 0 times
managementmercurialcommandsourcedistributedclihgcontrol

Problem

How to use the hg command: Mercurial - a distributed source control management system. Some subcommands such as commit have their own usage documentation. More information: <https://www.mercurial-scm.org/help/commands>.

Solution

hg — Mercurial - a distributed source control management system. Some subcommands such as commit have their own usage documentation. More information: <https://www.mercurial-scm.org/help/commands>.

Create an empty Mercurial repository:
hg init


Clone a remote Mercurial repository from the internet:
hg clone {{https://example.com/repo}}


View the status of a local repository:
hg status


Add all new files to the next commit:
hg add


Commit changes to version history:
hg commit {{[-m|--message]}} {{message_text}}


Push local changes to a remote repository:
hg push


Pull any changes made to a remote:
hg pull


Reset everything the way it was in the latest commit:
hg update {{[-C|--clean]}}; hg purge

Code Snippets

Create an empty Mercurial repository

hg init

Clone a remote Mercurial repository from the internet

hg clone {{https://example.com/repo}}

View the status of a local repository

hg status

Add all new files to the next commit

hg add

Commit changes to version history

hg commit {{[-m|--message]}} {{message_text}}

Context

tldr-pages: common/hg

Revisions (0)

No revisions yet.