Reputation: 2436
I have some UTF-8 encoded text file, is it possible to make git to ignore the UTF-8 BOMs when commit? I know git can auto convert different EOLs ("\r"
, "\n"
, "\r\n"
), but can I make git to ignore the BOMs and only commit the file contents?
PS: I already have a tool to remove text files's UTF-8 BOMs, but it's inconvenient, I have to run it every time before I commit, it will be more convenient if there's a way to make git to auto process the BOMs.
Upvotes: 8
Views: 3537
Reputation: 155366
Use the pre-commit
hook, which is designed for such a purpose.
Upvotes: 1