xcodegitderived

How to remove an unused source control master in Xcode?


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?


Solution

  • 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.