哪个 SCM 系统适用于 Xcode?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/431881/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 02:57:08  来源:igfitidea点击:

Which SCM system for Xcode?

cocoaxcodesvnmacosversion-control

提问by Gregor

I am developing an application for the Mac as a small team (me + another person) effort. We are located in different cities, and have started to see the need for solid source control management.

我正在为 Mac 开发一个小团队(我 + 另一个人)的应用程序。我们位于不同的城市,并且已经开始看到对可靠的源代码控制管理的需求。

None of us have any experience with this, and both of us are relatively new to Cocoa/Obj-C/Xcode (but do have C knowledge).

我们都没有这方面的经验,而且我们俩都是 Cocoa/Obj-C/Xcode 的新手(但确实有 C 知识)。

Does anyone have any recommendations as to which SCM system to choose? I understand that a lot of people are using Subversion, which is also supported in Xcode 3.1. Does anyone have experience with using Subversion through Xcode? Or is it a better option to chose a stand alone GUI alternative, such as Versions?

有没有人对选择哪种 SCM 系统有任何建议?我知道很多人都在使用 Subversion,Xcode 3.1 也支持它。有没有人有通过 Xcode 使用 Subversion 的经验?还是选择独立的 GUI 替代方案(例如版本)是更好的选择?

Grateful for any input on this.

感谢您对此的任何投入。

Gregor Tomasevic, Sweden

格雷戈尔·托马塞维奇,瑞典

Update/personal experiences: Since this post, we have tried Versions and Cornerstone (both of which are SVN GUI-clients), as well as Xcodes built-in support for SVN. We were not particularly pleased with Versions, which seemed to have some problems with committing unversioned files/build files. The built-in SVN support in Xcode works quite well, although it probably has limitations that we have still not run into. Cornerstone is both simple to use and powerful, and does not seem to suffer from the problems we encountered with Versions.

更新/个人经验:自这篇文章以来,我们尝试了 Versions 和 Cornerstone(两者都是 SVN GUI 客户端),以及 Xcodes 对 SVN 的内置支持。我们对版本不是特别满意,它似乎在提交未版本化的文件/构建文件方面存在一些问题。Xcode 中内置的 SVN 支持工作得很好,尽管它可能有我们尚未遇到的限制。Cornerstone 既简单易用又功能强大,似乎没有遇到我们在 Versions 中遇到的问题。

So far, we have just tried committing, updating repo, checking out latest/previous versions of our files and worked some with file comparison. It might be a whole different ball game once you start working extensively with branching, an area which we have been told both these GUI clients might have some weaknesses in.

到目前为止,我们刚刚尝试提交、更新 repo、检查我们文件的最新/以前版本并进行了一些文件比较。一旦你开始广泛地使用分支,这可能是一个完全不同的球类游戏,我们被告知这两个 GUI 客户端可能存在一些弱点。

For what it's worth (and with only days of evaluation) Cornerstone seems to be a somewhat better alternative, although for simpler SCM, Xcode works well too.

就其价值而言(并且仅进行了几天的评估),Cornerstone 似乎是一个更好的选择,尽管对于更简单的 SCM,Xcode 也能很好地工作。

Thanks for all the comments.

感谢所有的评论。

采纳答案by Dirk Stoop

You can't really go wrong with using Subversion.

使用 Subversion 绝对不会出错。

If, like me, you don't like Xcode's SVN integration too much you can always choose to use the command-line tools, or one of the several GUI apps like Versions, CornerStone or SvnX. Most of these tools work together pretty well, so you're not necessarily tied in to the tool you start out with.

如果像我一样,你不太喜欢 Xcode 的 SVN 集成,你可以随时选择使用命令行工具,或者几个 GUI 应用程序之一,如 Versions、CornerStone 或 SvnX。这些工具中的大多数都可以很好地协同工作,因此您不必拘泥于您开始使用的工具。

I personally do most of my work with Versions, and use the command-line tools with the same working copies every once in a while.

我个人使用 Versions 完成我的大部分工作,并且每隔一段时间使用具有相同工作副本的命令行工具。

If you're comfortable working with command-line tools exclusively until someone creates a good GUI app around it, git is a pretty viable option too.

如果在有人围绕它创建一个好的 GUI 应用程序之前,你习惯于专门使用命令行工具,那么 git 也是一个非常可行的选择。

disclosure: I'm one of the people who work on Versions, so I might be slightly biased ;)

披露:我是从事版本工作的人之一,所以我可能有点偏见;)

回答by Peter Hosey

Xcode only supports Subversion, Perforce, and CVS. However, there are also distributed version control systems out there, such as Mercurial, Bazaar, and Git. These have no Mac-native GUIs, but you should still consider them. Personally, I love managing my projects in Mercurial repositories.

Xcode 仅支持 Subversion、Perforce 和 CVS。但是,也有分布式版本控制系统,例如 Mercurial、Bazaar 和 Git。这些没有 Mac 原生 GUI,但您仍然应该考虑它们。就我个人而言,我喜欢在 Mercurial 存储库中管理我的项目。

[Added 2011-03-10] Xcode 4 adds support for Git. Several of us have filed requests for Mercurial support; you should, too, if you want it.

[2011-03-10 添加] Xcode 4 添加了对 Git 的支持。我们中的一些人已经提交了 Mercurial 支持请求;如果你愿意,你也应该这样做。

回答by nushoin

There is a nice GUI frontend for Mercurial on Mac called MacHG: http://jasonfharris.com/machg/

Mac 上的 Mercurial 有一个很好的 GUI 前端,称为 MacHG:http://jasonfharris.com/machg/

It is free and very nice IMHO.

恕我直言,它是免费的,而且非常好。

回答by David Grant

Xcode's Subversion support is pretty good. 90% of the SVN activities I perform are easily doable from Xcode. For the other few things I just fire up Terminal.

Xcode 的 Subversion 支持非常好。我执行的 90% 的 SVN 活动都可以从 Xcode 轻松完成。对于其他几件事,我只是启动终端。

There are a couple things in their SVN client implementation that are annoying:

他们的 SVN 客户端实现中有一些令人讨厌的事情:

  • The code that checks to see which local files have been modified seems to run on a background timer, and its pretty latent. Sometime it takes 5 minutes for Xcode to show a file as modified. The same thing is even more exaggerated w/r/t remote modifications.
  • Sometimes when you rename or delete a file that isn'tunder source control, a dialog will appear, asking "Do you wish to [rename/delete] this file in SVN as well?" And the options are "Yes" or "Cancel." You choose Yes out of desperation only to be presented with a well-deserved SVN error.
  • 检查哪些本地文件已被修改的代码似乎在后台计时器上运行,并且非常隐蔽。有时 Xcode 需要 5 分钟才能显示已修改的文件。同样的事情在远程修改的情况下更加夸张。
  • 有时,当您重命名或删除不受源代码控制的文件时,会出现一个对话框,询问“您是否也希望在 SVN 中[重命名/删除]此文件?” 选项是“是”或“取消”。您出于绝望选择“是”,结果却出现了当之无愧的 SVN 错误。

Overall, I'd recommend it.

总的来说,我会推荐它。

回答by Genericrich

Caveat: If you simply tell XCode to add a project to a repository by giving it the top-level dir, it WILL add the build directory to the repository, which of course is a terrible thing to do.

警告:如果你只是告诉 XCode 通过给它顶级目录来将项目添加到存储库,它会将构建目录添加到存储库,这当然是一件可怕的事情。

In order to get around this you have to move the build dir to another location so that XCode won't try to import it, or manually add the discrete folders of a project one by one.

为了解决这个问题,您必须将构建目录移动到另一个位置,这样 XCode 就不会尝试导入它,或者手动一个一个地添加项目的离散文件夹。

回答by Marc Charbonneau

Subversion is the traditional OS X source control solution, in Leopard it's supported in Xcode and OS X, not to mention the third party GUI apps (a few of which look very slick). Despite all of this though, a lot of the independent OS X developers have switched to Git over the past year or two. As a single developer I can tell you Git has turned out to be a very good solution for me, and along with Github it makes a great solution for a small team effort.

Subversion 是传统的 OS X 源代码控制解决方案,在 Leopard 中,Xcode 和 OS X 都支持它,更不用说第三方 GUI 应用程序(其中一些看起来非常漂亮)。尽管如此,在过去的一两年里,许多独立的 OS X 开发人员已经转向 Git。作为一个单独的开发人员,我可以告诉你 Git 对我来说是一个非常好的解决方案,并且与 Github 一起为小型团队工作提供了一个很好的解决方案。

回答by eageranalyst

If you're interested in using Mercurial on OS X, try SourceTree, it's not free but it's competitively priced and has a very polished Mac OS feel. I've been using it for personal projects for the last few months on and off and find it intuitive and reasonably robust.

如果您对在 OS X 上使用 Mercurial 感兴趣,请尝试使用 SourceTree,它不是免费的,但价格具有竞争力,并且具有非常精美的 Mac OS 感觉。在过去的几个月里,我断断续续地将它用于个人项目,并发现它直观且相当强大。

It's available through the Mac App Store and supports Git and Mercurial. They have a website at http://www.sourcetreeapp.com/with more information.

它可通过 Mac App Store 获得并支持 Git 和 Mercurial。他们有一个网站http://www.sourcetreeapp.com/提供更多信息。

回答by PEZ

If your going for subversion, I've heard good things said about Springloops. I code together with some friends too in a similar fashion and we use Github. Git is such a wonderful experience. I don't use any GUI for it since I'm much more efficient with a shell prompt. But of course, I'd welcome if Xcode had support for Git repos.

如果您要颠覆,我听说过有关Springloops 的好消息。我也以类似的方式与一些朋友一起编码,我们使用Github。Git 真是一次美妙的体验。我不使用任何 GUI,因为我使用 shell 提示效率更高。但当然,如果 Xcode 支持 Git 存储库,我会很高兴。

回答by Greg

Mercurial (like git) is "distributed" and perhaps regarded as more modern and up-and-coming than svn (but less established). If you want to auto-checkin using mercurial, you can add the line:

Mercurial(如 git)是“分布式的”,可能被认为比 svn 更现代、更前卫(但不太成熟)。如果要使用 mercurial 自动签入,可以添加以下行:

hg commit -m "Xcode auto commit"

hg commit -m "Xcode 自动提交"

as part of a "Run Script" stage of the XCode build, as found in: Project > New Build Phase > New Run Script BUild Phase

作为 XCode 构建的“运行脚本”阶段的一部分,如:项目 > 新构建阶段 > 新运行脚本构建阶段