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

Almost every time I create a text file (most of them), I get a message from git gui (I use msysgit) that it replaced (or just about) the line endings with CRLF. Obviously, I want this (and there settings for it huraah), but I do not want the annoying message to appear all the time!

How to save settings, but disable / disable pop-up message?

I have no idea how this works with git on the command line, but I like the msysgit linking process :), so I would rather not switch to bash.

+6
git newline git-gui core.autocrlf
source share
5 answers

The command line just prints the message and what it is.

I do not think the message box may be disabled, unfortunately ...

+1
source share

One thing you can do is set the appropriate setting in repo-config. The core.autocrlf option will do the following:

  • All text files will be saved at the end of the LF line.
  • When reading from disk, CRLF converted to LF
  • When writing to disk, LF 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 except the .git folder itself from the repo and run

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

To fix it end of line.

PS: There is a small chance that binaries are accidentally created as text files and may be damaged, then you should read the manual or just ask here.

+7
source share

Perhaps make sure: core.autocrlf=false .

I really don't know msysgit, but after a bit of searching I found a couple of related msysgit / themes .
Also see Related SO Q: What is the best CRLF handling strategy with git? .

+1
source share

Simple, use CRLF as line endings in a text editor, and git will not warn you anything. (Execpt can be done once if the dragged-out file does not have CRLF line endings).

+1
source share

Since you are using msysgit, I assume that the core.autocrlf parameter core.autocrlf set to true (the default value in the msysgit installation)

You can try setting core.safecrlf to false and see if this affects such a message.

 git config core.safecrlf false 

You can also try the .gitattributes version and install:

 * eol=crlf 

to find out if this explicit text attribute has anything to do with this warning message.

0
source share

All Articles