【问题标题】:Visual Studio 2017, change to data model changes all line endingsVisual Studio 2017,更改为数据模型会更改所有行尾
【发布时间】:2018-09-09 08:01:59
【问题描述】:

我们两个人在做同一个项目。如果我们中的任何一个对实体框架(edmx)进行了小改动,似乎项目中的所有 *.cs 文件都被更改了,并且在我的情况下添加了额外的行尾(即像双行间距)。因此,如果我进行数据模型更改,我会对所有 *.cs 文件进行更改,然后将其推送到 GIT,如果他随后进行更改,也会发生同样的事情。 是否可以停止 VS 对所有 *.cs 文件进行更改? 如果没有,是否有设置告诉它我想要什么样的行距(结尾)? 请注意,打开项目时不会出现此问题(即不检查行尾的选项)-仅在对实体框架进行更改时才会出现。

【问题讨论】:

  • 你有.gitattributes 文件吗?
  • 不。只有一个 .gitignore

标签: c# visual-studio entity-framework


【解决方案1】:

如果您实际上没有添加.gitattributes(在.gitignore 旁边)文件,则一种方法可能是不添加。 如果您修改 *.edmx 文件,更改也将在模型类上完成。因此应该有所修改。

.gitattributes 可能包含:

# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.sln text eol=crlf
*.csproj text eol=crlf
*.vbproj text eol=crlf
*.fsproj text eol=crlf
*.dbproj text eol=crlf

*.vcxproj text eol=crlf
*.vcxitems text eol=crlf
*.props text eol=crlf
*.filters text eol=crlf

*.cs     diff=csharp

# Standard to msysgit
*.doc    diff=astextplain
*.DOC    diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot  diff=astextplain
*.DOT  diff=astextplain
*.pdf  diff=astextplain
*.PDF    diff=astextplain
*.rtf    diff=astextplain
*.RTF    diff=astextplain

【讨论】:

    猜你喜欢
    • 2019-08-09
    • 1970-01-01
    • 2014-12-04
    • 1970-01-01
    • 1970-01-01
    • 2017-12-18
    • 2017-11-25
    • 1970-01-01
    • 2018-03-25
    相关资源
    最近更新 更多