xcode 我应该在 SVN 中提交 .xcodeproj 文件吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6120091/
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
should I commit .xcodeproj file in SVN?
提问by Saurabh
Should I commit the project file (.xcodeproj)? When I commit this file from one system and update it on a second system, the project gets corrupted and Xcode won't open it.
我应该提交项目文件 (.xcodeproj) 吗?当我从一个系统提交此文件并在第二个系统上更新它时,该项目已损坏并且 Xcode 无法打开它。
Is this expected behavior, or am I maybe doing something wrong? Here is my list of ignored files:
这是预期的行为,还是我做错了什么?这是我忽略的文件列表:
*.o,*.lo,*.la,*.al,.libs,*.so,*.so.[0-9]*,*.a,*.pyc,*.pyo,*.rej,*~,#*#,.#*,.*.swp,.DS_Store,*.pbxuser,*.perspective,*.perspectivev3,*.project.xcworkspace,*.xcuserdata,*.mode1v3,*.mode2v3,build/,build,/build/
*.o,*.lo,*.la,*.al,.libs,*.so,*.so.[0-9]*,*.a,*.pyc,*.pyo,*.rej,*~,#*#,.#*,.*.swp,.DS_Store,*.pbxuser,*.perspective,*.perspectivev3,*.project.xcworkspace,*.xcuserdata,*.mode1v3,*.mode2v3,build/,build,/build/
Should I add something to this list? Should I forget the SVN and switch to GIT?
我应该在这个列表中添加一些东西吗?我应该忘记 SVN 并切换到 GIT 吗?
I am using Cornerstone as SVN client and using Xcode 3.2.5
我使用 Cornerstone 作为 SVN 客户端并使用 Xcode 3.2.5
Please help; I am stuck!
请帮忙; 我被卡住了!
回答by justin
do commit and track it. specifically, there are a few bits in there which you want - the most important is project.pbxproj. it looks like you have already ignored the user-specific pieces (which is good).
提交并跟踪它。具体来说,您需要其中的一些位 - 最重要的是 project.pbxproj。看起来您已经忽略了特定于用户的部分(这很好)。
problem is, it will conflict often in distributed environments. break your projects and/or their definitions into smaller pieces to avoid this risk. the project file is a text format - it will merge without issue in some cases.
问题是,它在分布式环境中经常会发生冲突。将您的项目和/或其定义分解成更小的部分以避免这种风险。项目文件是一种文本格式 - 在某些情况下它会毫无问题地合并。
i do not track these:
我不跟踪这些:
*.xcbkptlist
*.xcuserstate
but you'll want to track someof the scheme and workspace files, new in Xc4. again, don't bother tracking the user defined bits, unless you really like them to be tracked, and you are the only person committing.
但您需要跟踪一些Xc4 中新增的方案和工作区文件。再说一次,不要费心跟踪用户定义的位,除非您真的喜欢跟踪它们,并且您是唯一提交的人。
another thing i recommend is to build to a central location which lies outside ofyour versioned source directories -- no build/
directories among the sources, even if they are ignored.
我建议的另一件事是构建到位于版本化源目录之外的中心位置——源中没有build/
目录,即使它们被忽略。
回答by Kazuki Sakamoto
Should I commit the project file (.xcodeproj) ?
我应该提交项目文件 (.xcodeproj) 吗?
The project file is project.pbxproj, Yes, definitely. project.pbxproj is an important file for Xcode project.
项目文件是project.pbxproj,是的,肯定的。project.pbxproj 是 Xcode 项目的重要文件。
回答by Sarah
I had the same problem with Cornorstone this is because the project file itself may have conflicts. One reason for that was I added a file from first machine and I did not commit and on the second machine also another file was added. The first who commits does not have a problem but when the second commit a conflict will occur. And also if you changed any attribute in the project configuration. A solution is to open the project file that has the conflict with text editor and solve the conflicts.
我对 Cornorstone 有同样的问题,这是因为项目文件本身可能存在冲突。一个原因是我从第一台机器添加了一个文件,但我没有提交,在第二台机器上还添加了另一个文件。第一个提交没有问题,但是当第二个提交时会发生冲突。此外,如果您更改了项目配置中的任何属性。解决办法是打开与文本编辑器有冲突的项目文件,解决冲突。