HG common commands

hg help : show help information of ;

Hg init: If you run this command in a non-empty directory, you will include existing files in the hg library.

hg add

Hg ci, short comments can be submitted directly with hg ci-m “short comment”. If no user is configured, the submission will fail. See “HG common configuration” in the note for user configuration methods.

Hg st: No parameter indicates the difference between tip and working dir

HG ST — Rev 19: Changes to version 19

Hg st –rev x:y: Compare the changes of x and y versions, the order of x and y does not matter;

Hg log hg log-l n: Shows only the nearest n changesets

Hg log-v: Contains a list of file changes and complete submission comments

Hg log-k “Your Name” : A list of changesets submitted by the user Your Name

Hg log-g: Lists changeset as a branch graph, used with the -l parameter

Hg log filename: Lists the information associated with the filename for each commit

hg push

Hg pull: pull the change_set to the local repository without affecting the files in the working directory;

hg pull -u <=> hg pull –update <=> “hg pull; hg update” <=> svn update

The difference between DVCS and SVN is that there are two types of synchronization in DVCS: between Repository and between local Repository and Working Directory. Push /pull is used to synchronize the former, and Update/Commit is used to synchronize the latter.

hg merge

Hg update: Update the working_copy file with the contents of the local repository;

Hg update-C: Discard local uncommitted changes and update working directory with files in repository;

hg cat filename

Hg diff file: Shows the changes made to a version

Hg diff-c 19 filename; Compare the differences between the two versions

hg diff -r 19 -r 20 filename