简体   繁体   中英

How to work on iOS project with SVN?

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?

I'm not an XCode developers, but do Subversion administration. I believe the .xcodeproj file isn'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.

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

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

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.

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 files are directories, and that Subversion is working the way it should. The Subversion command line wouldn't have any issues with these .pbxuser files.

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.

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM