git-annex-unlock(1)
π git-annex-unlock(1) β bestie edition
okay so you found the git-annex-unlock page in the General Commands Manual and honestly? iconic choice. this is the one that unlocks files for modification. let's get into it π«Ά
β¨ NAME β¨
git-annex-unlock β unlock files for modification
πΈ SYNOPSIS πΈ
git annex unlock [path ...]
π¦ DESCRIPTION π¦
so like, normally? the content of annexed files is protected from being changed. it's giving museum glass, look don't touch π . Unlocking an annexed file is what allows it to be modified. and if you specify no files at all, every annexed file in the current directory gets unlocked. the whole squad. periodt.
Now here's the tea β β unlocking a file changes how it is stored in the git repository (it goes from a symlink to a pointer file), so this command will make a change that you can commit. like, it's a real change, not just a vibe.
But wait, don't panic: the content of an unlocked file is still stored in git-annex, not git. and when you commit modifications to the file, those modifications will also be stored in git-annex, with only the pointer file stored in git. so git stays skinny, git-annex holds the substance. main character energy, honestly. π
If you use git add to add a file to the annex, it will be added in unlocked form from the beginning. this unlocks (lol) a whole workflow where a file starts out unlocked, gets modified as necessary, and is locked once it reaches its final version. glow-up pipeline. β¨
β οΈ okay bestie listen up because this part is important: normally, unlocking a file requires a copy to be made of its content, so that its original content is preserved while the copy can be modified. it's a safety copy, it's not free.
To use less space, annex.thin can be set to true; this makes a hard link to the content be made instead of a copy. (Only when supported by the file system.) While this can save considerable disk space, any modification made to a file will cause the old version of the file to be lost from the local repository. so, enable annex.thin with care. fr fr. π¨
π EXAMPLES π
# git annex unlock disk-image
# git commit -m "unlocked to allow VM to make changes as it runs"
# git annex unlock photo.jpg
# gimp photo.jpg
# git commit photo.jpg -m "redeye removal"
# gimp photo.jpg
# git commit photo.jpg -m "fix oversaturation" # git annex lock
photo.jpg
look at that little photo.jpg workflow, she's doing the work. unlock, edit, commit, edit, commit, lock. π
π OPTIONS π
- file matching options β the
git-annex-matching-options(1)can be used to specify files to unlock. so you can be picky about which files get the treatment π― --jsonβ Enable JSON output. This is intended to be parsed by programs that use git-annex. Each line of output is a JSON object. robots-only zone, no cap π€--json-error-messagesβ Messages that would normally be output to standard error are included in the JSON instead. so your error messages get folded into the JSON too, nothing gets lost π
Also the git-annex-common-options(1) can be used. those ones always come to the party π
π SEE ALSO π
(the lock one is literally the reverse move, go read it, they're a matched set π«Ά)
π AUTHOR π
Joey Hess <id@joeyh.name>
and that's the whole page bestie, git-annex-unlock(1), out here doing the most for your file-modification needs π go unlock something, commit it, and live your truth. 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
- 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
- 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