With stash -k you can test without committing first. Although git is very flexible regarding this, I prefer to at least test the code before committing it.
`git checkout-index` allows you to run tests on the index before committing and without messing with your working tree. The only downside is that it might take a while for a large project. Example script: https://github.com/philc/vimium/blob/master/git_hooks/pre-co...