Disable git EOL Conversions

前端 未结 5 1111
醉梦人生
醉梦人生 2020-12-07 11:47

I am trying to get git to not change any line endings whatsoever for any operation. Unfortunately, it seems to do so not matter what. I have reduced it down to the followi

5条回答
  •  日久生厌
    2020-12-07 12:13

    One simple solution is:

    • make sure core.autocrlf is set to false for all repos:
      git config --global core.autocrlf false
    • re-clone your repo, and check no EOL conversion is done.
    • or, since Git 2.16 (Q1 2018), keep your current repo, and do a git add --renormalize .

    If there are conversions automatically done, that mean a .gitattributes core.eol directive is there within the repo.

    With Git 2.8+ (March 2016), check if there are still eol transformation with:

    git ls-files --eol
    

提交回复
热议问题