简体   繁体   English

提交前确认

[英]Git Confirm Before Commit

Is there a way to configure Git to give me an alert before or after I commit locally? 有没有一种方法可以配置Git在本地提交之前或之后向我发出警报? For example, after I commit (ideally before), I get some kind of output like "Did you double check settings.py?". 例如,在我提交之后(最好是在提交之前),我会得到某种输出,例如“您是否仔细检查过settings.py?”。 Alternatively, can I script this using bash? 另外,我可以使用bash编写脚本吗? I've been looking around, but I haven't found much on the topic.. Thanks in advance! 我一直在四处张望,但在该主题上却找不到很多..预先感谢!

The pre-commit hook should give you the opportunity to do what you want. 提交前的钩子应该使您有机会做自己想做的事情。

See http://www.git-scm.com/book/en/Customizing-Git-Git-Hook . 参见http://www.git-scm.com/book/en/Customizing-Git-Git-Hook The example scripts contain good documentation. 示例脚本包含良好的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM