Do you have a checklist that you run through before committing your code? Before I send my code up to BitBucket/GitHub I have a basic bash script that asks me a few questions; if I have kept inline with coding standards, if I have commented on my code, ran unit tests etc. This bash script runs on Unix based OS’s forces you to answer these questions before your code is committed.
Here is the current script I have saved in my
/usr/bin directory for PHP development. Note it uses mercurial but can of course be updated to use Git by changing line 21 and 26.
This can be installed by running the following code from the command line:
Now in the terminal when you run ‘commit’ the script should kick in like so: