LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

hg-init

creates a new Mercurial repository in the specified directory or current

TLDR

Create repository in current directory
$ hg init
copy
Create repository in new directory
$ hg init [project-name]
copy

SYNOPSIS

hg init [options] [dest]

DESCRIPTION

hg init creates a new Mercurial repository in the specified directory or current directory if none given. It creates a .hg subdirectory containing all version control data. After initialization, use hg add to track files and hg commit to save changesets. The working directory contains the source files while .hg stores the repository history.

PARAMETERS

DEST

Directory to create the repository in; created if it doesn't exist. Defaults to the current directory.
-e, --ssh CMD
Specify ssh command to use (for remote destinations).
--remotecmd CMD
Specify hg command to run on the remote side.
--insecure
Do not verify the server certificate.
--help
Display help information.

INSTALL

sudo apt install mercurial
copy
sudo dnf install mercurial
copy
sudo pacman -S mercurial
copy
sudo apk add mercurial
copy
sudo zypper install mercurial
copy
brew install mercurial
copy
nix profile install nixpkgs#mercurial
copy

CAVEATS

Fails if the destination already exists as a non-empty, non-repository directory. Initializing inside an existing repository creates a nested repo, which is usually unintended.

HISTORY

Init is a core Mercurial command, present since the project's first release in 2005.

SEE ALSO

hg(1), hg-add(1), hg-commit(1), hg-clone(1)

RESOURCES

Copied to clipboard
Kai