Mercurial --------- Creating a repository ''''''''''''''''''''' To turn a folder into a repository: .. code-block:: shell $hg init Adding files to the tracking: .. code-block:: shell $hg add If no filename is provided all files are added Removing a file from tracking: .. code-block:: shell $hg forget To commit your changes: .. code-block:: shell $hg commit -m To push your fork back into the main repository: .. code-block:: shell $hg push If your hg destination is empty it will default to the one specified in the hgrc file. The hgrc file should be inside the repository, in the .hg folder, and should cotain the lines: .. code-block:: shell [paths] default= default-push= Another hgrc file should be inside the home folder and should cotain the lines: .. code-block:: shell [ui] username = [extensions] strip = The strip extension is used to remove changesets from the history and delete their files. Use like this: .. code-block:: shell $hg strip To branch a repository: .. code-block:: shell $hg branch To navigate between the changesets, first list them: .. code-block:: shell $hg history Then see where you are in it: .. code-block:: shell $hg summary If you want some visual aid do: .. code-block:: shell $hg serve And to change the state of the repository to the desired changeset by doing: .. code-block:: shell $hg update If left blank, will update to the tip of the repository. To merge branches first update into the receiving branch, then: .. code-block:: shell $hg merge If conflicts happen, they can be solved by manually marking as solved: .. code-block:: shell $nano $hg resolve -m Or they can be marked for replacement by: .. code-block:: shell $hg resolve -t internal:local $hg resolve -t internal:other Where local means the updated into branch and other is the one being merged to it, so the first option keeps the file while the second overwrites it.