git-annex/ git-annex-uninit

# NAME

git-annex uninit - de-initialize git-annex and clean out repository

# SYNOPSIS

git annex uninit

# DESCRIPTION

Use this to stop using git annex. It will unannex every file in the repository, and remove all of git-annex's other data, leaving you with a git repository plus the previously annexed files.

# OPTIONS

- `--json`

  Enable JSON output. This is intended to be parsed by programs that use git-annex. Each line of output is a JSON object.

- `--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) can be used.

# SEE ALSO

git-annex(1)

git-annex-unannex(1)

git-annex-init(1)

# AUTHOR

Joey Hess id@joeyh.name

Warning: Automatically converted into a man page by mdwn2man. Edit with care.

comment 5

A faster way of doing uninit is the following:

`cp --no-clobber --dereference --recursive --preserve=all --reflink=auto --verbose ./git_annex_repo/your_symlinks/ ./target_dir/`

This will simply copy (thin COW copy) symlinks (dereferenced) as normal files preserving the mtime, etc. the resulting ./target_dir/ will have your files if they existed in this annex or broken symlinks if the files were not here.

Comment by eric.w — Wed Oct 29 14:05:27 2025
comment 4

Moved some comments about a bug to uninit fails when I symlink your symlink. Please do not use this man page's comment section to file bug reports.

Comment by joey — Wed Oct 29 14:05:27 2025
comment 2

Obvious reason is that it's not something often used or that has had much demand for being sped up. And in particular it's written as a call to unannex each annexed file, and that runs `git rm --cached` once per file, which can be slow.

But there are also non-obvious things that it may need to do that can be slow. For example, if two files in the git repo point to the same git-annex object, it has to make a copy of the object to one of the worktree files.

Comment by joey — Wed Oct 29 14:05:27 2025
Why so slow
Why is uninit so slow? Shouldn’t it simply consist of moving the files out of the annex and then delete the .git folder?
Comment by chocolate.camera — Wed Oct 29 14:05:27 2025
Comments on this page are closed.