0

Can I suppress such messages in the console of Git Bash (the output of the git commit command)?

warning: LF will be replaced by CRLF in 1.txt.
The file will have its original line endings in your working directory.

The --quiet option doesn't do it.

Andrey Bushman
  • 11,712
  • 17
  • 87
  • 182
  • **See Also**: [With Git, how do I turn off the "LF will be replaced by CRLF" warning](https://stackoverflow.com/q/6500880/1366033) – KyleMit Jan 02 '22 at 13:55

1 Answers1

2

Disable the safecrlf configuration:

git config core.safecrlf false

core.safecrlf

If true, makes Git check if converting CRLF is reversible when end-of-line conversion is active. Git will verify if a command modifies a file in the work tree either directly or indirectly. For example, committing a file followed by checking out the same file should yield the original file in the work tree. If this is not the case for the current setting of core.autocrlf, Git will reject the file. The variable can be set to "warn", in which case Git will only warn about an irreversible conversion but continue the operation.

hjpotter92
  • 78,589
  • 36
  • 144
  • 183