4

Is there any way I can check for whitespace/tab (i.e. don't use tab, use spaces instead, and do have end of line space) in my git commits?

I have ~ 10 commits, I want to double check them before I push.

What Git mechanism should apply for this case?

VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
michael
  • 99,904
  • 114
  • 238
  • 340

1 Answers1

0

The right way to "double check" is through a pre-commit hook to detect whitespace errors.
(You will find hook examples there)

Trying to do that just before a push is a bit late, even though git1.8.2 has now a pre-push hook.

You can still:

  • put a pre-commit hook in place
  • do a rebase -i HEAD~10 (replaying all your 10 commits), which will trigger that pre-commit hook.
Community
  • 1
  • 1
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755