Senior LevelGit & GitHub
How do Git Clean and Smudge filters execute transparent content transformations?
❓ Interview Prompt: Explain Git Attribute filter drivers (Clean filter vs Smudge filter), transparent encryption/decryption, and environment token injection.
Clean filters transform content when files are staged (git add) to strip secrets; Smudge filters transform content when checking out files to disk to decrypt or inject tokens.
Code Implementation Example
ini
[filter "secret-encrypt"]
clean = gpg --encrypt
smudge = gpg --decrypt
secrets.json filter=secret-encrypt💡Configuring Git Clean and Smudge filters for transparent file encryption.
🎯 Interview Key Takeaway
Clean filters transform content when staging (add); Smudge filters transform content when checking out (checkout).
#Clean Filter#Smudge Filter#.gitattributes#Senior
Back to all Git & GitHub Questions→