git-annex-lock(1)

πŸ“¦
version 10.20261026 Β· 3 versions
, in alpine 3.24, arch rolling, debian trixie, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… 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. πŸ’…βœ¨πŸŽ€