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

# git-annex-init(1)

initialize git-annex

## NAME

git-annex-init - initialize git-annex

## SYNOPSIS

git annex init **\[description\]**

## DESCRIPTION

Until a repository (or one of its remotes) has been initialized, git-annex will refuse to operate on it, to avoid accidentally using it in a repository that was not intended to have an annex.

It's useful, but not mandatory, to initialize each new clone of a repository with its own description. If you don't provide one, one will be generated using the username, hostname and the path.

If any special remotes were configured with autoenable=true, this will also attempt to enable them. See [git-annex-initremote(1)](/git-annex-initremote/1.md). To prevent that, re-enable a remote with "autoenable=false", or mark it as dead (see [git-annex-dead(1)](/git-annex-dead/1.md)).

This command is entirely safe, although usually pointless, to run inside an already initialized git-annex repository. It avoids overwriting things like the uuid of the repository. It also avoids autoenabling any more special remotes, since it is not safe to do so.

A top-level **.noannex** file will prevent git-annex init from being used in a repository. This is useful for repositories that have a policy reason not to use git-annex. The content of the file will be displayed to the user who tries to run git-annex init.

The annex.pre-init-command git configuration or pre-init-annex hook is run before initialization and can exit nonzero as well to prevent initialization, as well as doing other setup.

## EXAMPLES

 \# git annex add foo\
  git-annex: First run: git-annex init\
  \# git annex init\
  init ok\
  \# git annex add foo\
  add foo ok

## OPTIONS

- **--version=N**

  -

  Force the repository to be initialized using a different annex.version than the current default.

-

  When the version given is not supported, but can be automatically upgraded to a newer version, it will use the newer version instead.

-

  - **--autoenable**

  Only enable any special remotes that were configured with autoenable=true, do not otherwise initialize anything.

-

  - **--no-autoenable**

  Do not enable special remotes that were configured with autoenable=true.

-

  - **--json**

  Enable JSON output. This is intended to be parsed by programs that use git-annex.

-

  - **--json-error-messages**

  Messages that would normally be output to standard error are included in the JSON instead.

-

  - Also the [git-annex-common-options(1)](/git-annex-common-options/1.md) can be used.

  ## SEE ALSO

[git-annex(1)](/git-annex/1.md)

[git-annex-describe(1)](/git-annex-describe/1.md)

[git-annex-reinit(1)](/git-annex-reinit/1.md)

[git-init(1)](/git-init/1.md)

## AUTHOR

Joey Hess \<id@joeyh.name\>
