Git can't check out on Linux with LF a file that was stored with CRLF

前端 未结 3 1540
盖世英雄少女心
盖世英雄少女心 2021-01-24 02:56

I am checking out a third party project \"libjpeg\" from https://github.com/winlibs/libjpeg on Linux (it is just one example, actually I have the same problem with many other pr

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-24 03:00

    The problem is that you have core.autocrlf set to true. The documentation says the following:

    Setting this variable to "true" is the same as setting the text attribute to "auto" on all files and core.eol to "crlf". Set to true if you want to have CRLF line endings in your working directory and the repository has LF line endings.

    You definitely don't want to set that variable to true on a Unix or Linux system; it should be set to false unless you're on a Windows system (and even then there are better alternatives).

提交回复
热议问题