c# – 我如何处理Git中的Visual Studio文件?

栏目: C# · 发布时间: 6年前

内容简介:代码日志版权声明:翻译自:http://stackoverflow.com/questions/21511959/how-i-deal-with-visual-studio-files-in-git

我通常使用.NET使用Git进行版本控制.在我的团队中,我们并行工作,我们经常提交我们的代码来整合应用程序.一切都很好,但Visual Studio的解决方案和项目文件.我们发现两种方法:

>永远不要提交这些文件,每个人都有自己的

>将这些文件包含在版本系统中

这两种方式都有优缺点,但是基本上我们每次从中央回购中抽出来都是斗争的.这里有一些我们发现的备用问题:(在上面列出的引文中)

>我们必须在项目(1)中包含其他人的文件,或者包括我们最新的(2)

>如果我们使用不同的架构(x86 / x64),我们必须手动更改.csproj文件(2)

>相同的问题回答了参考和NuGet包

等等.我可以使用适当的工作流程吗?

提交.sln和.csproj文件通常是最佳实践(如 this answer ),但合并需要注意.

参见“ Why are my .csproj files getting messed up after a git rebase ?

”.

* .csproj -text merge = union(见下文)

* .sln -text merge = unionv

或者您可以放弃.csproj并在本地重新生成 as in this tweet .

忽略这些csproj文件的另一个原因是,如果它们被重新生成,则为 in this context

yellowblood 警告( in the comments )关于csproj文件与merge = union策略一起使用时的严重冲突问题.

这回应了文章“ Merge conflicts in csproj files ”.

这就是为什么有一个 suggestion for VS IDE should support file patterns in project files (为了不修改.csproj文件,如果添加一个适合该模式的新的.cs文件).

It’s been suggested that if Visual Studio sorted its elements first, that would help mitigate the problem.  That helps reduce the incidental conflicts caused by Visual Studio’s apparent non-deterministic sort of elements.  But it doesn’t make the issue of merge conflicts go away.

代码日志版权声明:

翻译自:http://stackoverflow.com/questions/21511959/how-i-deal-with-visual-studio-files-in-git


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Elements of Statistical Learning

The Elements of Statistical Learning

Trevor Hastie、Robert Tibshirani、Jerome Friedman / Springer / 2009-10-1 / GBP 62.99

During the past decade there has been an explosion in computation and information technology. With it have come vast amounts of data in a variety of fields such as medicine, biology, finance, and mark......一起来看看 《The Elements of Statistical Learning》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换