4 ms·
I usually do something like: git add -p git commit git stash <run tests> If it fails then I can stash pop and commit -p --amend and try again.
by tjdetwiler 14y ago
I usually do something like:
git add -p
git commit
git stash
<run tests>
If it fails then I can stash pop and commit -p --amend and try again.
- _ikke_ 14y agoWith 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.
- int3 14y ago`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-commit https://github.com/philc/vimium/blob/master/git_hooks/pre-co...