Xcode git showing multiple repositories
git, xcode, xcode10
Solution
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.
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:
- 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.
- 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.
- Repeat this process for all other red highlighted files and close Xcode.
- Relaunch Xcode and Open project by double clicking .xcodeproj or .xcworkspace file. Do not open project from Xcode welcome screen or recent files.
- Try pushing now. you will see only one repository now.
You can rename "Project-old-check" back to "Project-old" now.
Hopefully this will help someone.
Problem
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: It's only occurring in one of my project while others are working fine.