QA
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→

More Git & GitHub Interview Questions

Beginner LevelGit & GitHub

Compare git rebase versus git merge and explain how git bisect finds regressions.

Beginner LevelGit & GitHub

What is the difference between git init and git clone?

Beginner LevelGit & GitHub

What are the Three Trees in Git (Working Directory, Staging Area / Index, Commit History)?