how to make git not change line endings for one particular file?

前端 未结 1 895
野趣味
野趣味 2021-02-02 05:47

due to a \"feature\" in Microsoft\'s Visual Studio, .sln files must have windows style line endings so that the windows explorer could open them in Visual studio. So I need to b

相关标签:
1条回答
  • 2021-02-02 06:28

    Take a look at the gitatttributes documentation. With recent versions of git, you can set the eol attribute for files to control what end-of-lines will be used when the file is checked out.

    You should be able to create a .gitattributes file in your repository that looking something like:

    path/to/my/file eol=crlf
    
    0 讨论(0)
提交回复
热议问题