Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: