2025-03-14 21:59:59 -06:00
|
|
|
# hg
|
|
|
|
|
|
|
|
|
|
> Mercurial - a distributed source control management system.
|
|
|
|
|
> Some subcommands such as `commit` have their own usage documentation.
|
2025-09-14 18:48:49 -06:00
|
|
|
> More information: <https://www.mercurial-scm.org/help/commands>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Create an empty Mercurial repository:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`hg init`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Clone a remote Mercurial repository from the internet:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`hg clone {{https://example.com/repo}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- View the status of a local repository:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`hg status`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Add all new files to the next commit:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`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`
|