xcode 从项目中删除存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18855849/
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
xcode remove repository from project
提问by bbrame
My xcode project has two repositories listed under the Source Control menu. One of them is a repository from an old project and should not be associated with the current project. However, I can not figure out how to remove it from the project.
我的 xcode 项目在 Source Control 菜单下列出了两个存储库。其中之一是来自旧项目的存储库,不应与当前项目相关联。但是,我不知道如何从项目中删除它。
NOTE: I have already removed this repository from Organizer.
注意:我已经从 Organizer 中删除了这个存储库。
Any help would be greatly appreciated.
任何帮助将不胜感激。
回答by Steven Grosmark
I did this by manually editing the .xccheckout
file.
我通过手动编辑.xccheckout
文件来做到这一点。
Here are the steps that should work for you:
以下是适合您的步骤:
- quit Xcode, and make a backup of your project file.
- in the Finder, right-click on your project file and select "Show Package Contents"
- right-click on the
project.xcworkspace
file, and select "Show Package COntents" - in the folder named
xcshareddata
, there is a file with the extension.xccheckout
(it should have the same name as your main project file, but with the.xccheckout
extension) - make a backup of this file
- open the
.xccheckout
file in your favorite plain-text editor - this is a plist. - find the
IDESourceControlProjectWCConfigurations
key, and look for the<dict>
that has the name of the repository that you want to remove. - in the same
<dict>
there is a keyIDESourceControlWCCIdentifierKey
whose value contains an identifier that looks like a UUID - this string identifies the repository. - search the entire file for key/string pairs that have the ID as the key. delete all these pairs.
- delete the
<dict>
- save the file
- re-open the project in Xcode, and make sure everything is good.
- 退出 Xcode,并备份您的项目文件。
- 在 Finder 中,右键单击您的项目文件并选择“显示包内容”
- 右键单击该
project.xcworkspace
文件,然后选择“显示包内容” - 在名为 的文件夹中
xcshareddata
,有一个带有扩展名的文件.xccheckout
(它应该与您的主项目文件同名,但带有.xccheckout
扩展名) - 备份这个文件
.xccheckout
在您最喜欢的纯文本编辑器中打开文件 - 这是一个 plist。- 找到
IDESourceControlProjectWCConfigurations
密钥,然后查找<dict>
具有要删除的存储库名称的密钥。 - 同样
<dict>
有一个键,IDESourceControlWCCIdentifierKey
它的值包含一个看起来像 UUID 的标识符——这个字符串标识了存储库。 - 在整个文件中搜索以 ID 作为键的键/字符串对。删除所有这些对。
- 删除
<dict>
- 保存文件
- 在 Xcode 中重新打开项目,并确保一切正常。
If it is still showing up, make sure that none of the files in your project are located in the directory of the old repository (via an absolute file reference). You can investigate this by opening up the main file project.pbxproj
, which is inside your project file.
如果它仍然出现,请确保项目中的所有文件都位于旧存储库的目录中(通过绝对文件引用)。您可以通过打开project.pbxproj
项目文件中的主文件来对此进行调查。
You can also test this out by temporarily renaming the root folder (in the Finder) of the old repository, and if the repository no longer shows up in the Source Control menu, then you have a file in your project that is located in that old repository.
您还可以通过临时重命名旧存储库的根文件夹(在 Finder 中)来测试这一点,如果存储库不再显示在源代码管理菜单中,那么您的项目中有一个位于旧存储库中的文件存储库。
回答by Abdurrahman Mubeen Ali
- Close XCode.
- Open Terminal.
- Navigate to the root directoryof the project.
- Type
find ./ -name .svn -exec rm -rf {} \;
. - Open your project.
- 关闭XCode。
- 打开终端。
- 导航到项目的根目录。
- 键入
find ./ -name .svn -exec rm -rf {} \;
。 - 打开您的项目。
Your project should be disconnected from all repositories. Now you may connect your project to the desired repository through Source Control -> Configure Project
.
您的项目应该与所有存储库断开连接。现在,您可以通过 将您的项目连接到所需的存储库Source Control -> Configure Project
。
NOTE: The command searches for all filenames with extension .svn
and removes (recursively and forcefully) all of them.
注意:该命令搜索所有带有扩展名的文件名.svn
并删除(递归和强制)所有文件名。
回答by Nareshkumar
You will have to manually remove the svn files from the old directory. This will be done using svn commands. You can find the commands below. How do you remove Subversion control for a folder?
您必须手动从旧目录中删除 svn 文件。这将使用 svn 命令完成。您可以在下面找到命令。 如何删除文件夹的 Subversion 控件?
回答by cubusaddendum
Actually, if you start Xcode without loading anything and then check out a fresh copy of your project into a new workspace folder, the irrelevant repository info gets automatically removed in your local copy of the project.
实际上,如果您在不加载任何内容的情况下启动 Xcode,然后将项目的新副本签出到新的工作区文件夹中,则不相关的存储库信息将自动从项目的本地副本中删除。
I also recommend that you navigate to Xcode -> Source Control -> %Repository% -> Configure %ProjectName% and select the working branch in the branches panel - just to make sure the trunk|tags|branches folder locations are correctly initialised. (You'll see the repository menu item in the Source Control menu update after you hit done, and the sub menu will expand to give you more options).
我还建议您导航到 Xcode -> Source Control -> %Repository% -> Configure %ProjectName% 并在分支面板中选择工作分支 - 只是为了确保 trunk|tags|branches 文件夹位置正确初始化。(点击完成后,您将在源代码管理菜单更新中看到存储库菜单项,并且子菜单将展开以提供更多选项)。
It's then a simple matter of committing those changes Xcode has made back to the same repository. The diff tool should indicate the lines of XML from that .xccheckout file that have changed and not much else.
然后将 Xcode 所做的这些更改提交回同一个存储库是一件简单的事情。diff 工具应该指出 .xccheckout 文件中已更改的 XML 行,而不是其他太多。
回答by phdfong - Kenneth Fong
I have experience with the dialog after going Source Control -> Checkout, what I did is simply remove/edit my account.
在进入源代码管理 -> 结帐后,我有使用对话框的经验,我所做的只是删除/编辑我的帐户。
Xcode -> Preference -> Accounts -> (do your edit or remove)
Xcode -> Preference -> Accounts ->(进行编辑或删除)
I am not 100% sure that also fix yours, but worth a try. By the way, I am using Xcode 6 beta.
我不是 100% 确定这也能解决你的问题,但值得一试。顺便说一下,我使用的是 Xcode 6 beta。