xcode 从项目中删除存储库 [英] xcode remove repository from project

查看:43
本文介绍了xcode 从项目中删除存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 xcode 项目在 Source Control 菜单下列出了两个存储库.其中之一是来自旧项目的存储库,不应与当前项目相关联.但是,我不知道如何从项目中删除它.

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.

注意:我已经从 Organizer 中删除了这个存储库.

NOTE: I have already removed this repository from Organizer.

任何帮助将不胜感激.

推荐答案

我通过手动编辑 .xccheckout 文件做到了这一点.

I did this by manually editing the .xccheckout file.

以下是适合您的步骤:

  1. 退出 Xcode,并备份您的项目文件.
  2. 在 Finder 中,右键单击您的项目文件并选择显示包内容"
  3. 右键单击project.xcworkspace 文件,然后选择显示包内容"
  4. 在名为 xcshareddata 的文件夹中,有一个扩展名为 .xccheckout 的文件(它应该与您的主项目文件同名,但带有 .xccheckout>.xccheckout 扩展名)
  5. 备份这个文件
  6. 在您最喜欢的纯文本编辑器中打开 .xccheckout 文件 - 这是一个 plist.
  7. 找到 IDESourceControlProjectWCConfigurations 键,然后查找具有要删除的存储库名称的 .
  8. 在同一个<dict>中有一个键IDESourceControlWCCIdentifierKey,它的值包含一个看起来像UUID的标识符——这个字符串标识了存储库.
  9. 在整个文件中搜索以 ID 作为键的键/字符串对.删除所有这些对.
  10. 删除
  11. 保存文件
  12. 在 Xcode 中重新打开项目,并确保一切正常.
  1. quit Xcode, and make a backup of your project file.
  2. in the Finder, right-click on your project file and select "Show Package Contents"
  3. right-click on the project.xcworkspace file, and select "Show Package COntents"
  4. 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)
  5. make a backup of this file
  6. open the .xccheckout file in your favorite plain-text editor - this is a plist.
  7. find the IDESourceControlProjectWCConfigurations key, and look for the <dict> that has the name of the repository that you want to remove.
  8. in the same <dict> there is a key IDESourceControlWCCIdentifierKey whose value contains an identifier that looks like a UUID - this string identifies the repository.
  9. search the entire file for key/string pairs that have the ID as the key. delete all these pairs.
  10. delete the <dict>
  11. save the file
  12. re-open the project in Xcode, and make sure everything is good.

如果它仍然出现,请确保您项目中的所有文件都位于旧存储库的目录中(通过绝对文件引用).您可以通过打开项目文件中的主文件 project.pbxproj 来调查此问题.

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.

您也可以通过临时重命名旧存储库的根文件夹(在 Finder 中)来测试这一点,如果存储库不再显示在源代码管理菜单中,那么您的项目中有一个文件位于在那个旧存储库中.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆