How to remove an unused source control master in Xcode?
Asked Answered
T

2

7

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?

Toronto answered 25/1, 2018 at 23:34 Comment(0)
T
12

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.

Toronto answered 25/1, 2018 at 23:34 Comment(2)
The file is located in Blueprint.xcscmblueprint so rm ~/Library/Developer/Xcode/DerivedData/MYPROJECT/Blueprint.xcscmblueprint seems to be enoughPurnell
@KévinRenella Indeed.Jeweljeweler
L
0

Based on Kévin Renella's answer, I manually modified ~/Library/Developer/Xcode/DerivedData/MYPROJECT/Blueprint.xcscmblueprint and just removed the offending repo along with any reference to that repo. No need to delete the whole file and risk loosing other repo references.

Lament answered 12/1, 2021 at 8:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.