Xcode git显示多个存储库 [英] Xcode git showing multiple repositories

查看:244
本文介绍了Xcode git显示多个存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在xcode中从事多个项目,所有项目都托管在GIT上,每个项目都有独立的存储库和多个分支.在我的项目之一中,它显示了多个存储库.这种情况是在进行拉/推/丢弃更改时发生的.

I'm working on multiple projects in xcode all are hosted on GIT with each having separte repository and multiple braches. In one of my project it is showing multiple repository. This case occurs while taking pull/push/discard changes.

是这种情况.我需要取消选中另一个以在当前项目中进行拉/推/丢弃.我也尝试过签出新项目.但是没有成功.如何在这里删除其他项目?

This is the case. I need to uncheck the other one to pull/push/discard in current project. I've tried checking out new project too. But no success. How can I remove the other project here?

PS:它仅发生在我的一个项目中,而其他项目运行良好.

PS: It's only occurring in one of my project while others are working fine.

推荐答案

在Xcode中处理多个项目时,我陷入了同样的问题.当我们从另一个项目添加文件时发生这种情况,因此Xcode也开始显示其他项目的存储库.这些文件没有完全复制到新项目中,而仅添加了引用.

I got stuck into the same issue while working on multiple projects in Xcode. This happens when we add files from another project and therefore the Xcode starts showing repository of other project also. The files are not exactly copied in the new project but only reference is added.

要解决此问题,请假定您已将文件从名为旧项目"的项目添加到名为新项目"的项目中.而且Project-new显示了多个存储库.现在,执行以下步骤:

To fix this issue lets assume you have added files from project named "Project-old" to project named "Project-new". And Project-new is showing multiple repositories. Now, do the following steps:

  1. 首先,您需要确定从Project-old添加的文件.最简单的方法是将Project-old文件夹临时重命名为"Project-old-check".现在打开新项目.您将在Xcode项目导航器中看到红色突出显示的文件.
  2. 选择突出显示的文件,然后从文件"检查器更新文件的路径.您可能需要使用Finder手动将此文件从旧项目"复制到新项目".
  3. 对所有其他红色突出显示的文件重复此过程,然后关闭Xcode.
  4. 通过双击.xcodeproj或.xcworkspace文件重新启动Xcode并打开项目.不要从Xcode欢迎屏幕或最新文件中打开项目.
  5. 立即尝试推动.您现在只会看到一个存储库.

您现在可以将"Project-new-check"重命名为"Project-new".

You can rename "Project-new-check" back to "Project-new" now.

希望这会对某人有所帮助.

Hopefully this will help someone.

这篇关于Xcode git显示多个存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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