Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT: How to get rid of the annoying CRLF message on msysgit (windows)?

Practically everytime I stage a textfile (that's most of em), I get the message from git gui (I use msysgit) that It replaced (or is about to) line endings with CRLF's. Obviously I want that (and there's a setting for it huraah), but I don't want the annoying message popped up all the time!

Any way to keep the setting, but turn off/disable the popup message?

I have no idea how this works with GIT on the commandline, but I like msysgit's staging process :) so I'd rather not change to bash.

like image 369
Rudie Avatar asked Oct 01 '10 16:10

Rudie


1 Answers

One thing you could do, is setting the appropriate setting in the repo-config. The option core.autocrlf will do these things:

  1. All text-files will be stored with LF line-endings.
  2. When reading from disk, CRLF is converted to LF
  3. When writing to disk, LF is converted to CRLF

You can set this option in git-shell

$ cd path/to/repo
$ git config core.autocrlf true

And then, delete any file but the .git folder itself from the repo and run

$ git reset --hard
$ git commit -am "Line endings fixed."

To fix he line endings.

PS: There is a small chance, that binary files are accidentially threated as text files and may be corrupted, then you have to read the manual or just ask here.

like image 174
fuz Avatar answered Sep 19 '22 23:09

fuz