git Visual Studio 2010 中的源代码管理?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3244320/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Source control in Visual Studio 2010?
提问by Sahat Yalkabov
After doing some search on SO, Google and MSDN forums I've become frustrated that there is so little information for what might seem like an obvious question and possibly a dumb question.
在 SO、Google 和 MSDN 论坛上进行了一些搜索后,我感到沮丧的是,对于看似明显的问题甚至可能是愚蠢的问题的信息太少了。
I need to use source control in Visual Studio 2010 Professional. I do not have separate Team Foundation Server 2010. Some people have mentioned SourceSafe? I haven't seen any SourceSafe inside of the Visual Studio 2010 to be honest.
我需要在 Visual Studio 2010 Professional 中使用源代码管理。我没有单独的 Team Foundation Server 2010。有人提到过 SourceSafe?老实说,我在 Visual Studio 2010 中没有看到任何 SourceSafe。
What are some alternatives (preferably free) for source control in Visual Studio 2010? Or is it already integrated in Visual Studio 2010 that I am so blind to have missed that?
Visual Studio 2010 中的源代码管理有哪些替代方案(最好是免费的)?或者它是否已经集成到 Visual Studio 2010 中以至于我很盲目地错过了它?
Update #1: Thank you everyone, I will go with SVN, in particular AnkhSVNfor Visual Studio 2010.
更新 #1:谢谢大家,我将使用 SVN,尤其是用于 Visual Studio 2010 的AnkhSVN。
Update 3/23/2011: It's been almost a year since I have asked this question. I highly recommend using either Mercurialor Gitover Subversion. So for those of you who are looking for Visual Studio 2010 version control system, look no further than Git or Mercurial extensions from the Visual Studio Extension Library.
2011年 3 月 23 日更新:我问这个问题已经快一年了。我强烈推荐使用Mercurial或Git 而不是 Subversion。因此,对于那些正在寻找 Visual Studio 2010 版本控制系统的人来说,Visual Studio 扩展库中的 Git 或 Mercurial 扩展就是您的最佳选择。
Update 5/16/2013: I would now strongly encourage you to use Gitover Mercurial, TFSor SVN. Take a look at CodeSchool'sTry GitHubin the browser to see how awesome it is!
2013 年 5 月 16 日更新:我现在强烈建议您使用Git 而不是Mercurial、TFS或SVN。看看CodeSchool 的Try GitHubin the browser 看看它有多棒!
Getting Started with Git on Visual Studio 2012- in-depth tutorial by Andy Lewis.
Visual Studio Tools for Git- An extension for Team Explorer to provide source control integration for Git. Enables integration with local Git repositories and provides tools to work with remote repositories.
在 Visual Studio 2012 上开始使用 Git-Andy Lewis的深入教程。
Visual Studio Tools for Git- 团队资源管理器的扩展,为 Git 提供源代码控制集成。启用与本地 Git 存储库的集成并提供用于处理远程存储库的工具。
采纳答案by Tomek Szpakowicz
See: List of Source Control Systems with Visual Studio Plugins
请参阅:带有 Visual Studio 插件的源代码控制系统列表
Visual Studio is just an IDE. You can use any source control solution that you want with it. Any open source source control solution in particular, like git, mercurial (hg) or subversion (svn). And there are commercial products like Perforce or SourceGear Vault. See herefor a pretty exhaustive list and google for more information.
Visual Studio 只是一个 IDE。您可以随心所欲地使用任何源代码控制解决方案。特别是任何开源控制解决方案,如 git、mercurial (hg) 或 subversion (svn)。还有像 Perforce 或 SourceGear Vault 这样的商业产品。见这里的一个非常详尽的清单,谷歌的更多信息。
You can find Visual Studio plugins that integrate it with any source control. Of open source ones subversion is especially rich in this regard. Commercial ones usually come with this integration.
您可以找到将其与任何源代码管理集成的 Visual Studio 插件。开源的subversion在这方面尤其丰富。商业的通常带有这种集成。
And if you are not using source control that requires you to explicitly check-out files to edit them (like VSS or TFS do), the IDE integration is not even essential. I personally prefer to use git or subversion from outside the IDE.
如果您不使用需要显式检出文件来编辑它们的源代码控制(如 VSS 或 TFS),则 IDE 集成甚至不是必需的。我个人更喜欢在 IDE 之外使用 git 或 subversion。
And please, stay as far from Visual SourceSafeas you can.
并且请尽可能远离Visual SourceSafe。
回答by Adrian Grigore
I am using Ankh SVNtogether with Subversionon the server side and it works fine for me. Mercurialand Gitare more popular than SVN lately though and there is also Visual HG, a Mercurial plugin for visual Studio.
我在服务器端使用Ankh SVN和Subversion,它对我来说很好用。Mercurial和Git最近比 SVN 更受欢迎,还有Visual HG,这是一个用于 Visual Studio 的 Mercurial 插件。
Edit:Meanwhile I switched to Mercurial (Tortoise HG plus Visual HG) and never looked back. It takes a few hours of getting used to Mercurial if you are coming from Subversion, but after that it really is a breeze. Even if you do not need a distributed CVS, Mercurial still has lots of nice features that are not available in Tortoise SVN. Plus, it does seem quite a bit more stable, especially with regards to branching.
编辑:同时我切换到 Mercurial(Tortoise HG 加上 Visual HG)并且再也没有回头。如果您来自 Subversion,则需要花几个小时来适应 Mercurial,但之后就真的轻而易举了。即使您不需要分布式 CVS,Mercurial 仍然有许多在 Tortoise SVN 中没有的好功能。另外,它看起来确实更加稳定,尤其是在分支方面。
回答by pablo
Let me add one more option to the list of SCMs integrated with Visual Studio 2010: Plastic SCM. You can check how it looks like here.
让我在与 Visual Studio 2010 集成的 SCM 列表中再添加一个选项:Plastic SCM。您可以在此处查看它的外观。
There's a Community Edition available.
有可用的社区版。
回答by CoderHawk
As @Tomek suggested use Subversion.
正如@Tomek 建议使用 Subversion。
Check out this post, which will help you to use subversion and AnkhSVN(VS plugin) with VS2010
查看这篇文章,它将帮助您在 VS2010 中使用 subversion 和 AnkhSVN(VS 插件)
回答by VTP
I have use Subversion and Mecurial on projects and both made me recall fondly working with the much hated (for good reason) Visual Source Safe. Both will "work", but both show their unix-programmer roots (no pun intended) with cryptic error messages and goofy, black magic nerdisms. Source control should be simple, reliable and stay out the way. Neither SNV nor Mecurial qualify. Mecurial is easier to use if nothing goes wrong -- which is about 80% of the time.
我曾在项目中使用过 Subversion 和 Mecurial,这两者都让我回想起与令人讨厌的(有充分理由的)Visual Source Safe 一起工作的美好时光。两者都可以“工作”,但都用神秘的错误消息和愚蠢的黑魔法书呆子来展示他们的 unix-programmer 根源(没有双关语意)。源代码控制应该简单、可靠并且不受影响。SNV 和 Mecurial 都不符合条件。如果没有任何问题,Mecurial 更容易使用——大约 80% 的时间。
If you are a single developer working alone, I would use Mercurial.
如果您是一个单独工作的开发人员,我会使用 Mercurial。
Here is a sample of why I hate these:
以下是我为什么讨厌这些的示例:
pushing to Z:\Repos\SupplierAdminWebRepo searching for changes new remote heads on branch 'default' [Error: abort: push creates new remote head 9cfbad6249a9!] new remote head 9cfbad6249a9 [Error: (did you forget to merge? use push -f to force)]
推送到 Z:\Repos\SupplierAdminWebRepo 在分支“默认”上搜索更改新远程头 [错误:中止:推送创建新远程头 9cfbad6249a9!] 新远程头 9cfbad6249a9 [错误:(你忘记合并了吗?使用 push -f强迫)]
[Operation completed. Exit code: 255]
【操作完成。退出代码:255]