2

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

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

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.

Vojtěch
  • 11,312
  • 31
  • 103
  • 173

1 Answers1

6

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

Community
  • 1
  • 1
manojlds
  • 290,304
  • 63
  • 469
  • 417
  • Well, last time I had installed git on my other machine, I did not have to write any hook. On the other hand, I don't want it to happen automatically, I just want to be warned. – Vojtěch Sep 16 '11 at 18:11