git-annex-smudge(1)
π git-annex-smudge β the git filter driver glow-up
okay bestie, this is git-annex-smudge(1) from the General Commands Manual, and it's genuinely one of the most underrated little gremlins in the whole git-annex family. let's get into it π«Ά
β¨ NAME β¨
git-annex-smudge β it's a git filter driver for git-annex, periodt.
πΈ SYNOPSIS πΈ
git annex smudge [--clean] file
git annex smudge --update
like, two whole modes. one for a file, one for the whole vibe check.
π¦ DESCRIPTION π¦
so the way this works: this command lets git-annex be used as a git filter driver, which means annexed files in the git repo can be unlocked instead of being symlinks π
, and it also lets git add store files in the annex.
when you add a file with git add, the annex.largefiles config gets consulted to decide if that file should just be added to git as-is, or if its content is large enough that it needs git-annex. and the annex.gitaddtoannex setting overrides that β set it to false and git add will literally not add files to the annex. no cap.
however (and this is the plot twist π) if git-annex can tell that a file was annexed before, it'll still add it to the annex even when those configs would normally prevent it. two examples of this, bestie:
- adding a modified version of an annexed file
- moving an annexed file to a new filename and adding that
the git configuration to use this command as a filter driver is as follows. this is normally set up for you by git-annex init, so you should not need to configure it manually:
[filter "annex"]
smudge = git-annex smudge %f
clean = git-annex smudge --clean %f
to make git actually use that filter driver, it needs to be configured in the .gitattributes file or in .git/info/attributes. the latter is normally configured when a repository is initialized, with the following contents:
* filter=annex
here's the thing though: the smudge filter does not give git the content of annexed files, because that would be slow and triggers memory leaks in git π. instead, it just records which worktree files need to be updated, and then git annex smudge --update later updates the work tree to contain the content. that one is run by several git hooks, including post-checkout and post-merge. but β and this is the part where you have to be your own main character β a few git commands, notably git stash and git cherry-pick, do not run any hooks. so after using those commands you can manually run git annex smudge --update (or git-annex fix) to update the working tree. π
β οΈ lowkey important: no hooks means no automatic update. if your worktree is looking dusty after agit stashorgit cherry-pick, that's why, and you gotta run the update yourself.
π OPTIONS π
- the
git-annex-common-options(1)can be used π
π SEE ALSO π
git-annex(1) git-annex-filter-process(1)
π AUTHOR π
Joey Hess <id@joeyh.name>
okay that's the whole page, bestie β¨ and if you made it to the end, you get the cute sign-off: this was git-annex-smudge(1) from the General Commands Manual β go forth, smudge responsibly, and remember to update that worktree πΈπ
π¦ 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 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
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms