Git没有警告写得不好的空白

时间:2011-09-16 17:01:57

标签: git whitespace

我已经设置了git的配置,以便'git config --list'给出以下内容:

core.editor=vim
core.whitespace=trailing-space,space-before-tab,indent-with-non-tab
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true

但是当我想提交一个文件whit尾随空格或其他空白问题时,它永远不会抱怨。不知道我能做什么。

1 个答案:

答案 0 :(得分:5)

为了在提交过程中警告你,我相信你必须编写一个pre-commit钩子来检查相应的空格并警告你。

有关删除空格的相关问题:Make git automatically remove trailing whitespace before committing