开发者

Git does not warn about badly written whitespace

开发者 https://www.devze.com 2023-04-05 15:27 出处:网络
I\'ve set config of git so that \'git config --list\' gives following: core.editor=vim core.whitespace=trailing-s开发者_JAVA百科pace,space-before-tab,indent-with-non-tab

I've set config of git so that 'git config --list' gives following:

core.editor=vim
core.whitespace=trailing-s开发者_JAVA百科pace,space-before-tab,indent-with-non-tab
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true

But when I want to commit a file whit trailing space or other whitespace problem, it never complains. Don't know what I can do.


For it to warn you during commit, I believe you have to write a pre-commit hook which will check for the appropriate whitespace and warn you.

Related question regarding removing whitespace: Make git automatically remove trailing whitespace before committing

0

精彩评论

暂无评论...
验证码 换一张
取 消