This is a quick note about a Git hook I use to double check that everything is fine before pushing to our remote Git repo.
This covers a paranoid scenario, I know, but sometimes a refactoring can go wrong and lose pieces between production code and tests: every now and then, one of my tests goes out-of-sync and when I push to Github/CI, I get some silly error because of a typo somewhere. This trick will re-run every Unit Test when I give git push and will actually push only if tests pass.
Create a file named pre-push and place it in your_repo/.git/hooks . Be sure the file is executable: chmod +x pre-push
There are tons of Git GUIs out there, ready to be installed with a couple of clicks. However, over the years I have always used Git Cola because it seems to be the only one providing one specific feature I use very often:
Many GUIs provide only something like this:
Hunks often are not small enough for my way of committing changes. I don’t like committing whole files or huge chunk of code. I prefer small commits: easy to review, easy to `git bisect` if something goes south, easy to `git cherry-pick` if necessary. I call them micro-commits and they are so radicated in my way of working that I simply cannot working without them.
Said that, Git Cola is a bit tricky to install on Mac OSX. Here are the necessary steps for you and future-me 🙂