Dies ist eine alte Version des Dokuments!
hg
lists basic commands, hg help
lists all commands and hg help <command>
shows the help for <command>
Sources: TipsAndTricks Extdiff extension HGBook
Download and install colordiff from www.slackbuilds.org. Then add the following to $HOME/.hgrc
:
[extensions] hgext.extdiff = [extdiff] cmd.cdiff = colordiff opts.cdiff = -uprN
Usage: hg cdiff [...] [| less -R]
Add the following to $HOME/.hgrc
:
[extensions] hgext.extdiff = [extdiff] cmd.kdiff = kompare
Cd into the root directory of your project and type hg init
. This merely creates the subdir .hg
which is the repository. The current dir becomes the working dir of the project.
Add all files to the project by hg add
and hg commit
Proposal: Have a central repository per project which is not worked on. For each subproblem to solve clone the central, work on the clone and push the modifications back to the central. More than one subproblem specific repostiories at the same time are possible and encouraged.
hg clone project project-subproblem # clone repository to get new working dir cd project-subproblem # make changes hg commit hg push ../project
Note, that after the push, the working dir in the central (project
) are not modified, the parent (hg parent
) is still the old revision. Use hg update
in the central to mend this.
hg revert <file1> [<file2>]
Restores the files in the working directory to the state when they had been last commited. Much more options are posssible, see hg help resore
Hgbook Wiki