Disable git EOL Conversions

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

    From gitattributes(5) Manual Page "Effects" topic

    text

    This attribute enables and controls end-of-line normalization. When a text file is normalized, its line endings are converted to LF in the repository. To control what line ending style is used in the working directory, use the eol attribute for a single file and the core.eol configuration variable for all text files.

    Set

    Setting the text attribute on a path enables end-of-line normalization and marks the path as a text file. End-of-line conversion takes place without guessing the content type.

    Unset Unsetting the text attribute on a path tells Git not to attempt any end-of-line conversion upon checkin or checkout.

    core.autocrlf in new (1.7.2+) Git not used, core.eol and correct setting|unsetting of text-attribute considered as more reliable way

提交回复
热议问题