如何在 xcode 中管理 svn 存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2780459/
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
How to manage svn repositories in xcode
提问by ratnasomu
I am using svn for my xcode project. I added two files to my current project, added them to the repository and commited changes for my classes folder. But when I try to commit the entire project, I get this error:
我在我的 xcode 项目中使用 svn。我向当前项目添加了两个文件,将它们添加到存储库并提交了对我的类文件夹的更改。但是当我尝试提交整个项目时,出现此错误:
Error: 155005 (Working copy not locked; this is probably a bug, please report) Description: Commit failed (details follow):
Error: 155005 (Working copy not locked; this is probably a bug, please report) Description: Directory '/Users/gopalmadhu/Desktop/All My data/Schduler current code/build/Debug-iphonesimulator/scheduler.app.dSYM/.svn' containing working copy admin area is missing
错误:155005(工作副本未锁定;这可能是一个错误,请报告)说明:提交失败(详细信息如下):
错误:155005(工作副本未锁定;这可能是一个错误,请报告)说明:目录'/ Users/gopalmadhu/Desktop/All My data/Schduler current code/build/Debug-iphonesimulator/scheduler.app.dSYM/.svn' 包含工作副本管理区域丢失
Due to this, the classes that are already checked in do not become visible when I check my code out. The files are in the project, but not visible. As a workaround, I need to add them again from the project folder to the classes folder. This is not the correct way of managing svn. What should I do?
因此,当我检出代码时,已经检入的类不会变得可见。这些文件在项目中,但不可见。作为一种解决方法,我需要将它们从项目文件夹再次添加到类文件夹。这不是管理 svn 的正确方法。我该怎么办?
回答by JeremyP
Your problem is in committing build results to Subversion.
您的问题在于将构建结果提交给 Subversion。
Subversion works by putting a hidden folder called .svn in every folder that is under version control. This does not work well with folders that might get deleted and recreated by a tool because the tool will probably not respect the existence of the .svn folder. That includes the whole build directory, the contents of which get wiped every time you clean your project targets.
Subversion 的工作原理是在每个受版本控制的文件夹中放置一个名为 .svn 的隐藏文件夹。这不适用于可能被工具删除和重新创建的文件夹,因为该工具可能不尊重 .svn 文件夹的存在。这包括整个构建目录,每次清理项目目标时都会擦除其中的内容。
You should remove your build directory from version control. It shouldn't be in there anyway since everything in it can be regenerated by doing an Xcode build. To get out of your existing dilemma try the following:
您应该从版本控制中删除您的构建目录。无论如何它都不应该在那里,因为其中的所有内容都可以通过进行 Xcode 构建来重新生成。要摆脱现有的困境,请尝试以下操作:
- Back up your project somewhere
- In a terminal go to your project directory and
rm -rf build
- do an
svn update
. At this point Subversion will hopefully restore the build directory. svn rm build
svn commit -m "Removed build from version control"
- (optional)
svn propedit svn:ignore .
This will bring up an editor for the svn:ignore property. Add build on a separate line. After that subversion won't show you the build directory insvn status
commands.
- 在某处备份您的项目
- 在终端中转到您的项目目录并
rm -rf build
- 做一个
svn update
。此时 Subversion 有望恢复构建目录。 svn rm build
svn commit -m "Removed build from version control"
- (可选)
svn propedit svn:ignore .
这将为 svn:ignore 属性打开一个编辑器。在单独的行上添加构建。之后,subversion 将不会在svn status
命令中向您显示构建目录。
回答by gagan sharma
You can also try....XCODE->Build->Cleaning All Targets option.That solved my problem !
您也可以尝试....XCODE->Build->Cleaning All Targets 选项。这解决了我的问题!