Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove an unused source control master in Xcode?

Tags:

git

xcode

derived

This is regarding Xcode 9.2. I added a framework (local Git repo) to my project, then deleted it when it did not do what I needed it to do. Now when I do a commit there is a popup with the old GIT master listed there, even though there are no source files for that repo in my project anymore.

In Xcode, in the Source Control Navigator, the unused GIT master repo was still listed there. I tried right clicking and the "Delete" option was grayed out:

enter image description here

I tried several command line GIT commands (found here on SO...) to clean things up but nothing had any affect.

I tried recreating the Xcode project from scratch and that unused GIT repo master still shows up in the Source Control Navigator.

I searched on SO for a couple of hours but didn't find anything regarding this issue.

So, how do you remove an unused source control master in Xcode?

like image 256
ByteSlinger Avatar asked Jan 25 '18 23:01

ByteSlinger


People also ask

How do I delete a Source Control project in Xcode?

In Xcode, choose Xcode-> Preferences, then select Source Control and uncheck Enable Source Control option. 2: Go to Xcode->Preference->Accounts->Repositories and delete them.

How do I delete a Source Control repository?

Right-click the project in the Project Explorer panel and then choose Source Control > Delete Repository from the context menu.

How do I delete a repository in Xcode?

search the entire file for key/string pairs that have the ID as the key. delete all these pairs. delete the <dict> save the file.

How do I remove a branch from git in Xcode?

Select a branch and click the minus button at the bottom to remove the branch. Note that Xcode does not let you remove the current branch. Apple moved the user interface for branches to the source control navigator in Xcode 9. To delete a branch, select it, right-click, and choose Delete.


1 Answers

I was searching around for references to the unused GIT repo and after spelunking around in the Terminal with this find/grep command:

find . -type f -exec grep -i MYREPONAME {} \;

I eventually found a reference here:

~/Library/Developer/Xcode/DerivedData/MYPROJECT

So I quit Xcode and I deleted that directory:

rm -rf ~/Library/Developer/Xcode/DerivedData/MYPROJECT

And now the reference to the unused GIT repo master is gone from my Xcode project. Perhaps this is an Xcode bug?

There may be a cleaner way to fix this problem, but this manual hack did work.

like image 114
ByteSlinger Avatar answered Sep 26 '22 19:09

ByteSlinger