Git不会对写得不好的空格发出警告
我已经设置了git的config,以便“git config--list”提供以下内容:Git不会对写得不好的空格发出警告,git,whitespace,Git,Whitespace,我已经设置了git的config,以便“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 但当我想提交一个有尾随空格或其他空格问题的文件时,它
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
但当我想提交一个有尾随空格或其他空格问题的文件时,它从不抱怨。不知道我能做什么。为了让它在提交期间警告您,我相信您必须编写一个
预提交
钩子,它将检查适当的空格并警告您
关于删除空白的相关问题:上次我在另一台机器上安装git时,我不需要编写任何钩子。另一方面,我不希望它自动发生,我只想得到警告。