笔试的世界很美好。但问题是,随着时间的推移,一些开发人员只是“忘记”(读作:不想,相信没有必要)在下一次提交之前运行所有测试用例,并在更新组件时更新测试用例。
使用 GIT,是否存在一种强制执行“在测试成功运行后才允许提交”的方法?
更新:我知道 pre、post hook,但我更多地寻找解决方案、recepts 等。
最佳答案
您可以在您的祝福存储库上使用预提交 Hook 。 引用 Git Community Book's entry on hooks :
GIT_DIR/hooks/pre-commit
This hook is invoked by 'git-commit', and can be bypassed with --no-verify option. It takes no parameter, and is invoked before obtaining the proposed commit log message and making a commit. Exiting with non-zero status from this script causes the 'git-commit' to abort.
关于ruby-on-rails - 如何执行 "just commit after test",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6915085/