git-annex-init(1)
π git-annex-init(1) β the manual page, bestie edition
okay so you found the git-annex-init page in the General Commands Manual and you're like "what is this" β don't worry, I got you β¨ this is the command that makes git-annex actually, like, work on your repo.
π NAME π
git-annex-init β literally just initialize git-annex. that's the whole job. iconic.
β¨ SYNOPSIS β¨
git annex init [description]
π¦ DESCRIPTION π¦
so here's the tea π΅ β until a repository (or one of its remotes, bestie, don't forget those) has been initialized, git-annex will straight-up refuse to operate on it. not being mean, it's just protective π«Ά it's avoiding the nightmare scenario of accidentally using git-annex in a repository that was never meant to have an annex. vibe check passed only after init, no cap.
it's useful (but not mandatory, so don't stress) to initialize each new clone of a repository with its own description π if you don't give it one, it'll just generate one for you using the username, hostname and the path. autopilot, slay.
if any special remotes were configured with autoenable=true, this will also attempt to enable them. see git-annex-initremote(1) for the deets πΈ want to prevent that? re-enable a remote with "autoenable=false", or mark it as dead (see git-annex-dead(1)). either works, pick your fighter π
this command is entirely safe β although usually pointless, ngl β to run inside an already initialized git-annex repository. it avoids overwriting things like the uuid of the repository π and it also avoids autoenabling any more special remotes, because apparently that is not safe to do. so it just... doesn't. good behavior honestly.
a top-level .noannex file will prevent git-annex init from being used in a repository π« super useful for repositories that have a policy reason not to use git-annex. and the content of that file gets displayed to the user who tries to run git-annex init β so you can leave them a little note π
the annex.pre-init-command git configuration or pre-init-annex hook is run before initialization, and it can exit nonzero as well to prevent initialization, plus it can do other setup. multi-tasking queen π
π₯ EXAMPLES π₯
# git annex add foo
git-annex: First run: git-annex init
# git annex init
init ok
# git annex add foo
add foo ok
see? it literally told you what to do. listen to it. π§
π OPTIONS π
--version=Nβ force the repository to be initialized using a differentannex.versionthan the current default. and if the version you gave isn't supported but can be automatically upgraded to a newer version, it'll use the newer version instead. glow-up behavior β¨--autoenableβ only enable any special remotes that were configured withautoenable=true, and don't otherwise initialize anything. minimal effort, respected π--no-autoenableβ do not enable special remotes that were configured withautoenable=true. the opposite of the above, obviously π--jsonβ enable JSON output. this is intended to be parsed by programs that use git-annex π€ so it's for the robots, not for your eyeballs.--json-error-messagesβ messages that would normally be output to standard error get included in the JSON instead. everything in one place, organized, gorgeous πΈ
also the git-annex-common-options(1) can be used. yes, those ones. use them.
π SEE ALSO π
π AUTHOR π
Joey Hess <id@joeyh.name> β the main character who made all this happen fr fr π
okay that's the whole page, bestie π«Ά this was git-annex-init(1) from the General Commands Manual, and the footer would just say git-annex-init(1) again β like yeah we know, it's the same page π anyway, go init something and slay π
β¨π
π¦ where this page comes from
- alpine 3.24: git-annex-doc 10.20261026-r0 Β· AGPL-3.0-or-later
- arch rolling: git-annex 10.20261026-2 Β· AGPL-3.0-only
- debian trixie: git-annex 10.20250416-2+deb13u1 Β· AGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms