3 ms·
I've had this issue affect me once or twice in the past (fortunately only with debugging settings, not secret keys). The solution for me was to create a pre-com
by malexw 14y ago
I've had this issue affect me once or twice in the past (fortunately only with debugging settings, not secret keys). The solution for me was to create a pre-commit script for git that looks through the diff of my commit for a special token, and aborts the commit if the token was found. Now when I make a change to a bit of code that shouldn't be committed, I'll throw in the token as an additional sanity check.
For someone who had never done any git scripting before, I was surprised at how easy it was to put together - just 9 lines of bash for the simplest thing that could possibly work: https://gist.github.com/4513374 https://gist.github.com/4513374