Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide a string in a file before git commit

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

like image 579
simao Avatar asked Feb 19 '10 00:02

simao


1 Answers

You could keep that string in a separate file (such as a resource file, if your environment supports that), and not put that file under version control.

like image 155
Sparr Avatar answered Oct 02 '22 05:10

Sparr