xcode从项目中删除存储库 [英] xcode remove repository from project
问题描述
我的xcode项目在源代码管理菜单下列出了两个存储库。其中一个是旧项目的存储库,不应与当前项目关联。但是,我无法弄清楚如何从项目中删除它。
注意:我已经从管理器中删除了这个存储库。
任何帮助将不胜感激。
我通过手动编辑 .xccheckout
文件完成了这项工作。 / p>
以下是适合您的步骤:
- 退出Xcode,并在Finder中右键单击您的项目文件并选择显示包装内容
- 右键单击您的项目文件,点击
project.xcworkspace
文件,然后在名为xcshareddata的文件夹中选择显示包裹控件
- ,有一个扩展名为
.xccheckout
的文件(它应该与您的主项目文件具有相同的名称,但使用.xccheckout
扩展名) - 创建该文件的备份
- 打开
。 xccheckout
文件在您喜欢的纯文本编辑器中 - 这是一个plist。 - 找到
IDESourceControlProjectWCConfigurations
键,然后查找具有该存储器名称的< dict>
在同一个< dict>
中,
- 有一个键
IDESourceControlWCCIdentifierKey
其值包含一个看起来像UUID的标识符 - 此字符串标识存储库。 - 在整个文件中搜索以ID为关键字的键/字符串对。
删除所有这些对。
- 删除
< dict>
- 保存文件
- 在Xcode中重新打开项目,并确保一切正常。
<如果它仍然显示出来,请确保项目中的文件都不在旧版本库的目录中(通过绝对文件引用)。您可以通过打开项目文件中的主文件 project.pbxproj
来调查。
您也可以通过临时重命名旧版本库的根文件夹(在Finder中)来测试,如果版本库不再显示在源代码管理菜单中,那么您的项目中有一个位于旧版本库中的文件。
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.
NOTE: I have already removed this repository from Organizer.
Any help would be greatly appreciated.
I did this by manually editing the .xccheckout
file.
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.
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.
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.
这篇关于xcode从项目中删除存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!