git-annex-lock(1)
π git-annex-lock
okay bestie, so this is the git-annex-lock page from the General Commands Manual β yes, section 1, the one you get when you type git annex lock and go "wait what did I just do". Let's get into it. π
β¨ NAME β¨
git-annex-lock β lock files to prevent modification
like, it does exactly what it says on the tin. locks your files so nobody (including you, bestie, especially you) can mess with them.
πΈ SYNOPSIS πΈ
git annex lock [path ...]
that's it. that's the whole vibe. paths optional, chaos optional, but the lock is real. π
π¦ DESCRIPTION π¦
so what does it actually do? it locks the annexed files you point it at, so they can't be modified. think of it as putting your files in a little glass display case. pretty! protected! untouchable! β¨
and if you don't give it any files at all? no worries, it just locks all the annexed files in the current directory. the whole squad gets locked. no cap.
here's the part that's actually important, bestie, listen up π β locking a file changes how it is stored in the git repository, going from a pointer file to a symlink. so this command makes a real change that you can commit. it's not just a state flag in the annex, it's a whole git-level transformation. it's giving main character energy in your index fr fr.
β οΈ heads up: because it changes how the file is stored in git, you're gonna want to commit that change. the command does not do it for you, iykyk. π
β¨ OPTIONS β¨
π file matching options
you can use the git-annex-matching-options(1) to specify files to lock. so instead of listing every single path like a chump, you describe which files you mean and let the matching options do the heavy lifting. iconic. π
π --json
turn on JSON output! this is intended to be parsed by programs that use git-annex. each line of output is a JSON object. so if you're a script, or you're feeding this into some pipeline, this is your girl. π«Ά
π --json-error-messages
messages that would normally be output to standard error are included in the JSON instead. so instead of your error screaming into the void of stderr, it gets neatly tucked into the JSON like a lil gift. perfect for programmatic besties who want everything in one stream. πβ¨
π also
the git-annex-common-options(1) can be used too. so many options, so little time.
π₯ SEE ALSO π₯
(yes, git-annex-unlock is the reverse. the yin to this yang. go read it if you want your files back in editable form. π)
π AUTHOR π
Joey Hess <id@joeyh.name>
absolute legend, thank you for your service. π«‘
and that's the whole page, bestie! git-annex-lock(1), from the General Commands Manual β section 1, locked, loaded, and slaying. now go lock something and commit it. periodt. π β¨π
π¦ 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 Β· AGPL-3.0-or-later
- debian trixie: git-annex 10.20250416-2+deb13u1 Β· AGPL-3.0-or-later
- epel 10: git-annex 10.20250320-1.el10_0 Β· AGPL-3.0-or-later
- fedora 43: git-annex 10.20250630-4.fc43 Β· AGPL-3.0-or-later
- fedora 43: git-annex 10.20250929-5.fc43 Β· AGPL-3.0-or-later
- fedora 44: git-annex 10.20260115-1.fc44 Β· AGPL-3.0-or-later
- nixos 26.05: git-annex 10.20260421
- nixpkgs unstable: git-annex 10.20260421
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 Β· AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 Β· AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 Β· AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- ubuntu noble: git-annex 10.20240129-1build1 Β· AGPL-3.0-or-later
- ubuntu questing: git-annex 10.20250721-1
- ubuntu resolute: git-annex 10.20251029-1ubuntu1 Β· AGPL-3.0-or-later
- ubuntu stonking: git-annex 10.20251029-1ubuntu1 Β· AGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms