GitHub for Windows预提交钩子 [英] GitHub for Windows Pre-Commit Hook
问题描述
我们有一个开发团队正在使用GitHub的50/50分割的窗口和Bash shell来管理他们的Git。
我们已经实现了预先提交钩子(设计用于运行单元测试并在测试失败时失败提交)。作为一个简化版本,我附上了一个减价版本,下面演示我们的问题。
#!/ bin / sh
exit 1
如果我们尝试从bash shell进行提交,按预期提交失败。但是,如果我们从GitHub for windows应用程序执行相同的提交,它将成功提交到本地repo。
那么有谁知道我们如何从GitHub获得相同的功能应用?不幸的是,我们无法将用户从应用程序中移除,现在它已成为一个明显的漏洞。
感谢您的帮助。
We have a development team that is using a 50/50 split of GitHub for windows and Bash shell for their Git management.
We have implemented a pre-commit hook (designed to run unit tests and fail the commit when tests fail). As a simplified version I have attached a cut down version below which demos our issue.
#!/bin/sh
exit 1
If we attempt a commit from the bash shell, the commit as expected fails. However if we perform the same commit from the GitHub for windows application it is successfully committed to the local repo.
So Does anyone know how we can get the same functionality from GitHub application? Unfortunately we can't move the users off the application, and its now an obvious hole.
Thanks for your help.
Sorry to be the bearer of bad news, but GitHub for Windows doesn't support pre-commit hooks, since it uses libgit2 to commit.
这篇关于GitHub for Windows预提交钩子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!