I would like a specific string in a specific file to be hidden every time I commit changes to that file.
Actually, I have a URL in a file that shouldn’t be public in a remote repository. Is there anyway to hide it using pre-commit and post-commit hooks or something similar?
Currently I am working with a git repository but it would be nice to know how to do this with svn.
Thanks,
Simão
If you really must have that file under version control, use a git attribute filter driver (see also GitPro book).
That way, the script (a private version, only in your repo, not managed by Git) referenced by the smudge can replace the coded URL, while the clean script will restore its content to a coded URL.
A public version of the same script, managed by git and pushed everywhere would do… nothing and keep the URL obfuscated.