Differences between revisions 8 and 9
Revision 8 as of 2008-01-12 23:46:55
Size: 2008
Editor: abuehl
Comment: rewrite
Revision 9 as of 2008-01-12 23:59:14
Size: 2195
Editor: abuehl
Comment: +hg init, link to ManPages
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:

An existing, already populated but yet untracked directory can be transformed into a repository with {{{hg init}}}, which creates and initializes the {{{.hg}}} subdirectory.
Line 15: Line 17:
See also: RepositoryNaming, PublishingRepositories, RepositoryConversion See also: ManPages, RepositoryNaming, PublishingRepositories, RepositoryConversion


(for a short intro of the basic concepts of Mercurial, see UnderstandingMercurial)

A repository is a directory (the repository directory or "repo" directory) which contains a subdirectory named .hg (dot hg) where Mercurial stores its internal data structures. Everything else (files and other subdirectories) in the repo directory is conceptually part of the [:WorkingDirectory:working directory], which is tracked by Mercurial (some files and subdirectories may be ignored. See [".hgignore"]).

An existing, already populated but yet untracked directory can be transformed into a repository with hg init, which creates and initializes the .hg subdirectory.

A file in the working directory that shall be tracked by Mercurial must be added with hg add. [:LocalModifications:Local modifications] to tracked files in the working directory can be [:Commit:committed] with hg commit, which adds a new [:ChangeSet:change set] to the repository by recording it in the .hg directory. The working directory can be restored with hg update to any previously committed state by specifying the requested changeset with its [:ChangeSetID:changeset ID].

Changesets can be transferred from one repository to another repository with hg pull, hg push, hg export and hg import (see ["Pull"], ["Push"], ["Export"], ["Import"], ["CommunicatingChanges"]).

Repositories can be [:Clone:cloned] with hg clone. Checking the internal integrity of a repository (the contents of .hg) can be done with hg verify.

Backing up a repository can be done by using push/pull/clone to a backup repository. A repository which is not actively written to (by other processes concurrently running on the computer) can be backed-up by backing-up the repo directory using normal directory/file backup procedures (like tar, zip, etc). The .hg directory is [:CaseFolding:case folding] tolerant, which means, it can for example be copied onto a FAT filesystem (see also ["CaseFoldingPlan"]).

See also: ManPages, RepositoryNaming, PublishingRepositories, RepositoryConversion


Repository (last edited 2013-03-25 18:30:23 by 208)