---
name: "hg-init"
section: "1"
platform: "linux"
package: "mercurial"
version: "7.2.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/hg-init"
---

# hg-init(1)

create a new repository in the given directory

## NAME

hg init - create a new repository in the given directory

## SYNOPSIS

```
hg init [-e CMD] [--remotecmd CMD] [DEST]
```

## DESCRIPTION

Initialize a new repository in the given directory. If the given directory does not exist, it will be created.

If no directory is given, the current directory is used.

It is possible to specify an **ssh://** URL as the destination. See **hg help urls** for more information.

Returns 0 on success.

## OPTIONS

- **-e,***--ssh* **\<CMD\>**

  specify ssh command to use

- **--remotecmd** *\<CMD\>*

  specify hg command to run on the remote side

- **--insecure**

  do not verify server certificate (ignoring web.cacerts config)
