Git pre-push hooks

前端 未结 7 1254
慢半拍i
慢半拍i 2020-11-28 02:47

I would like to run a unit-tests before every git push and if tests fails, cancel the push, but I can\'t even find pre-push hook, there is pre-commit and pre-rebase only.

相关标签:
7条回答
  • 2020-11-28 03:34

    If you are using the command line, the easiest way to do this is to write a push script that runs your unit tests and, if they succeed, completes the push.

    Edit

    As of git 1.8.2 this answer is outdated. See manojlds's answer above.

    0 讨论(0)
提交回复
热议问题