xcode 如何使用 SVN 处理 iOS 项目?

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

How to work on iOS project with SVN?

xcodesvnios

提问by Johnny

When add/removing files/changing setting, the .xcodeproj will get changed. And if multiple people try to do that on the same project, because SVN is not as smart as git, it will cause issue every time, is there way to get around this issue besides talking to everybody each and every time?

添加/删除文件/更改设置时,.xcodeproj 将被更改。而且如果多个人在同一个项目上尝试这样做,因为SVN不如git聪明,每次都会出现问题,除了每次都和大家交谈之外,有没有办法解决这个问题?

采纳答案by David W.

I'm not an XCode developers, but do Subversion administration. I believe the .xcodeproj fileisn't really a file, but a directory that contains both project information and user information. Subversion stores that directory into the repository as a directory. This is good.

我不是 XCode 开发人员,而是做 Subversion 管理。我相信 .xcodeproj文件并不是真正的文件,而是一个包含项目信息和用户信息的目录。Subversion 将该目录作为目录存储到存储库中。这很好。

The file project.pbxprojinside that directory contains the project information, and this too should be saved in Subversion. It's how the project is configured.

project.pbxproj目录中的文件包含项目信息,这也应该保存在 Subversion 中。这就是项目的配置方式。

The individual *.pbxuser files are for the particular user and should not be in the SVN repository. This is where your problem resides.

单独的 *.pbxuser 文件是针对特定用户的,不应位于 SVN 存储库中。这就是您的问题所在。

Actually, it resides in the fact that Mac OS X pretends that some directories are merely folders that contain resource information. This usually ends up causing developer confusion since their browser shows a single file and not a directory.

实际上,它存在于 Mac OS X 假装某些目录只是包含资源信息的文件夹的事实。这通常最终会导致开发人员混淆,因为他们的浏览器显示的是单个文件而不是目录。

XCode probably does the right thing if a user is doing their Subversion operations inside XCode. (I know Eclipse does). And, if the user was using the Subversion command line, they'd immediately see that certain filesare directories, and that Subversion is working the way it should. The Subversion command line wouldn't have any issues with these .pbxuser files.

如果用户在 XCode 中执行 Subversion 操作,XCode 可能会做正确的事情。(我知道 Eclipse 确实如此)。而且,如果用户使用 Subversion 命令行,他们会立即看到某些文件是目录,并且 Subversion 正在以它应该的方式工作。Subversion 命令行不会对这些 .pbxuser 文件产生任何问题。

The problem usually resides when users use a Subversion GUI that uses the Finder as the browser -- like the way TortoiseSVN on Windows uses Explorer. This combined with XCode can cause problems.

当用户使用使用 Finder 作为浏览器的 Subversion GUI 时,问题通常存在——就像 Windows 上的 TortoiseSVN 使用资源管理器的方式一样。这与 XCode 结合可能会导致问题。

The best way to handle this is to create a pre-commit hook that will fail a commit if a user tries to add in a *.pbxuser user file. (And to remove all *.pbxuser files from the repository). These users will quickly learn to put those *.pbxuser files in their Subversion ignore setting.

处理此问题的最佳方法是创建一个预提交挂钩,如果用户尝试添加 *.pbxuser 用户文件,该挂钩将导致提交失败。(并从存储库中删除所有 *.pbxuser 文件)。这些用户将很快学会将这些 *.pbxuser 文件放在他们的 Subversion 忽略设置中。

There are quite a file pre-commit hooks in both Perl and Python that can handle this.

Perl 和 Python 中有相当多的文件预提交钩子可以处理这个问题。

回答by BastiBen

I think Xcode 4 has built-in support for SVN which helps with these issues quite a bit.

我认为 Xcode 4 内置了对 SVN 的支持,这对解决这些问题有很大帮助。