Git pre-push hooks

前端 未结 7 1294
慢半拍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:13

    Git got the pre-push hook in the 1.8.2 release.

    Sample pre-push script: https://github.com/git/git/blob/87c86dd14abe8db7d00b0df5661ef8cf147a72a3/templates/hooks--pre-push.sample

    1.8.2 release notes talking about the new pre-push hook: https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.2.txt

提交回复
热议问题