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

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

问题描述

我的xcode项目在源代码管理菜单下列出了两个存储库。其中一个是旧项目的存储库,不应与当前项目关联。但是,我无法弄清楚如何从项目中删除它。

注意:我已经从管理器中删除了这个存储库。





任何帮助将不胜感激。

解决方案

我通过手动编辑 .xccheckout 文件完成了这项工作。 / p>

以下是适合您的步骤:


  1. 退出Xcode,并在Finder中右键单击您的项目文件并选择显示包装内容

  2. 右键单击您的项目文件,点击 project.xcworkspace 文件,然后在名为 xcshareddata的文件夹中选择显示包裹控件

  3. ,有一个扩展名为 .xccheckout 的文件(它应该与您的主项目文件具有相同的名称,但使用 .xccheckout 扩展名)

  4. 创建该文件的备份

  5. 打开。 xccheckout 文件在您喜欢的纯文本编辑器中 - 这是一个plist。

  6. 找到 IDESourceControlProjectWCConfigurations 键,然后查找具有该存储器名称的< dict> 在同一个< dict> 中,
  7. 有一个键 IDESourceControlWCCIdentifierKey 其值包含一个看起来像UUID的标识符 - 此字符串标识存储库。

  8. 在整个文件中搜索以ID为关键字的键/字符串对。
    删除所有这些对。
  9. 删除< dict>

  10. 保存文件

  11. 在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:

  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.

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

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