Simply re-checkout everything.
cd /path/to/your/repo
git stash save
rm .git/index
git checkout HEAD -- "$(git rev-parse --show-toplevel)"
git stash pop
The smudge filter will be applied at that new checkout.
Note, as seen in this answer, you need to remove the index in order to force the filter to run again.
Alexander Amelkin comments below:
I have created an alias 'reattr
' to perform all those steps and now I am happy.
reattr = !sh -c ""git stash save; rm .git/index; git checkout HEAD -- "$(git rev-parse --show-toplevel)"; git stash pop""
(multi-line for readability)
reattr = !sh -c ""git stash save;
rm .git/index;
git checkout HEAD -- "$(git rev-parse --show-toplevel)";
git stash pop""
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…