Disable git EOL Conversions

前端 未结 5 1098
醉梦人生
醉梦人生 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:12

    Here is how you do this for a single repo.

    Create the file .gitattributes at the root of the repo with this line in it

    * -text
    

    That's it. This is a wildcard matching all files, telling git to unset the text attribute. This means git treats all files as binary, and thus does not perform any line-ending conversion.

提交回复
热议问题