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

前端 未结 3 1500
盖世英雄少女心
盖世英雄少女心 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:20

    You more than likely have set up some of the flags that tell git to mess up with EOL formats (and those flags are a mess). If you would rather have git not mess with them, you can do so by adding this to .gitattributes:

    * -text
    

    That way git won mess with the files when you add them or checkout. If you need some other kind of thing (like, real automatic EOL conversion), you might check the available things there.

    https://git-scm.com/docs/gitattributes

    Either way, steer away from using the flags you used on the question. They are a mess.

提交回复
热议问题