---
name: "git-annex-lock"
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-lock"
---

# git-annex-lock(1)

lock files to prevent modification

## NAME

git-annex-lock - lock files to prevent modification

## SYNOPSIS

git annex lock **\[path ...\]**

## DESCRIPTION

Lock the specified annexed files, to prevent them from being modified. When no files are specified, all annexed files in the current directory are locked.

Locking a file changes how it is stored in the git repository (from a pointer file to a symlink), so this command will make a change that you can commit.

## OPTIONS

- file matching options

  -

  The [git-annex-matching-options(1)](/git-annex-matching-options/1.md) can be used to specify files to lock.

-

  - **--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)](/git-annex-common-options/1.md) can be used.

  ## SEE ALSO

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

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

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

## AUTHOR

Joey Hess \<id@joeyh.name\>
