Xcode git 显示多个存储库

Roh*_*uru 9 git xcode ios swift xcode10

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

在此处输入图片说明

情况就是这样。我需要取消选中另一个以在当前项目中拉/推/丢弃。我也试过检查新项目。但没有成功。如何在此处删除其他项目?

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

Nab*_*eel 11

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

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. First you need to identify files which are added from Project-old. Easiest way is to rename the Project-old folder temporarily to "Project-old-check". Now open Project-new. you will see the red highlighted files in Xcode project navigator.
  2. Select the highlighted file and update the path of file from File inspector. You may need to copy this file from Project-old to Project-new manually with Finder.
  3. Repeat this process for all other red highlighted files and close Xcode.
  4. Relaunch Xcode and Open project by double clicking .xcodeproj or .xcworkspace file. Do not open project from Xcode welcome screen or recent files.
  5. Try pushing now. you will see only one repository now.

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

Hopefully this will help someone.


emr*_*tar 5

尝试删除“派生数据”文件夹来解决问题。

注意:您可以使用路径到达派生数据文件夹;

Xcode -> 首选项 -> 位置


Kra*_*inh 0

如果我正确理解您的问题,那么在这种情况下,您为相关项目配置了多个遥控器。要进行验证,您可以打开命令提示符并转到项目目录。

类型git remote -v。这将为您提供所有遥控器的列表。您可以使用 删除不需要的远程位置git remote rm destinationUrl。要了解有关分离遥控器的更多信息,请单击此处

删除额外的遥控器后,您将在 xCode 窗口中仅看到一个选项。如果您想知道什么是远程的,那么可能会对您有所帮助。

  • 我有同样的问题,但“git remote -v”只显示一个正确的存储库。源代码管理导航器显示两个存储库,其中不需要的存储库甚至列出了我最近所做的一些提交,这些提交实际上从未发送到这个不正确的目标,因为我在推送之前未选中此目标(幸运的是,这些提交实际上也不在该远程中)。真是一团糟! (3认同)