4

I have been working on an Xcode project (that is installed via adhoc installation, for internal use at my company) for a few years now and I had enabled source control since day 1. All was working perfectly until when iOS 8 was released, i decided to convert it into iOS 8 while leaving a backup on the project as it is. So, I renamed the original folder to bimpd_old and started modifying the new project. I am a beginner in git, and I didn't know that doing this might corrupt source control. After doing so (and while still working on both projects) my source control won't commit anymore complaing that the project is not under version control.

I tried many solutions on the internet that suggest deleting .svn/.git folders, disabling and reenabling source control, run git init, add *, commit.. I also tried deleting the bimPd.xccheckout EDIT: I already tried the solution from: How to disassociate working copy of an Xcode 5 project from SVN server that died with no success. Probably that solution works only for Xcode5 while my issue is in Xcode 6.3

I just want to lose all version history, detach/delete all working copies, and start new version control starting today.

How can I achieve that?

Notes:

  • At first, Xcode gave me a warning that svn needs to be updated.. I did it but still it wouldn't commit
  • I don't need online git (just local)
  • I stopped working on the old project.. and I don't need it anymore.
  • After all my tests and trials, it currently shows 3 working copies in my source control (when I enable it) and I only want one working copy (screenshot below)

working copies

  • At earlier stages, when I was trying to commit, xcode was giving me a warning that it's unable to commit to www.mydomain.com/bimpd (a custom svn that a friend had made on his site a long time ago) but i can't find this reference anywhere.. (because i have deleted all repositories)
  • Now when I try to commit, i get the following error: the working copy "bimpd.xcodeproject" failed to commit files (screenshot below)

commit error

Community
  • 1
  • 1
Dany Balian
  • 608
  • 7
  • 16
  • possible duplicate of [How to disassociate working copy of an Xcode 5 project from SVN server that died](http://stackoverflow.com/questions/20846210/how-to-disassociate-working-copy-of-an-xcode-5-project-from-svn-server-that-died) – bahrep Apr 30 '15 at 20:28

7 Answers7

7

Check out this answer

Just navigate to "Your Project".xcodeproj > (Right Click & Show Package Contents) > project.xcworkspace > (Right Click & Show Package Contents) > xcSharedData > "Your Project".xccheckout

Right Click on the file and select Open with, and click on "More..". Use your preferred Text Editor to edit the XML inside, or you can always use the trusty TextEdit.

Your old git/svn servers are probably at the bottom, encased in . Just remove em and reload your project in Xcode.

Community
  • 1
  • 1
david72
  • 7,151
  • 3
  • 37
  • 59
  • 1
    i already tried this, i even tried to delete the file completely with no success.. – Dany Balian Apr 30 '15 at 23:16
  • 1
    is it an option to delete .git folder, and then clean the xccheckout, and then do git init? which means deleting the local git – david72 May 01 '15 at 04:00
  • yes it is, and i had already tried it many times.. with no luck! however, i just did it in this specific order and it works! disabled source control from xcode> deleted git/svn folders > cleaned up xccheckout file > went to xcode projects and deleted my project from there > git init, add ., commit > enabled source control from xcode > open my project and voila! could you edit your solution to this exact order, so that i accept your answer? because the order seems to be crucial to the fix! – Dany Balian May 02 '15 at 07:21
3

I believe @david72 has the correct answer. (I didn't find @dandoonian "order of steps is crucial" to be the case for me.)

My problem was my project was using an .xcworkspace. So for me, the path to find the file was:

projectname.xcworkspace(show package contents) -> xcshareddata -> projectname.xcscmblueprint

I edited that file (took out the "working copies" I didn't need any more), re-saved, and restarted xCode. Voila.

coco
  • 2,998
  • 1
  • 35
  • 58
2

Just to summarize what solved the problem using @david72's help (in one of the comments)

P.s. The order of steps is crucial!

  1. Disable source control from xcode
  2. Delete git/svn folders
  3. Clean up xccheckout file
  4. Go to xcode projects and delete the project from there
  5. Reinitialize git: git init, add ., commit
  6. Re-enable source control from Xcode
  7. Re-open project
Dany Balian
  • 608
  • 7
  • 16
2

Remove all unrequited repo from following location

DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey

You can remove all unrequited working copy using following linked steps. Multiple Working Copy

Community
  • 1
  • 1
Piyush
  • 1,156
  • 12
  • 20
1

Many of these solutions mention deleting the .git folder - it should be noted that this action will delete any stashes and local branches you may have in reserve.

I learned this the hard way... and this issue with the extra root-repo showing wasn't even resolved for me! Terrible outcome.

(Apologies, I currently do not have the 50 reputation to simply comment on an answer!)

0

I had to delete the dreaded Derived Data folder after running pod install.

I was using cocoa pods. My commit on the Xcode client was a mess despite my gitHub being just fine.

  1. pod install in my directory with podfile
  2. Delete contents of ~/Library/Developer/Xcode/DerivedData
  3. Restart computer
  4. Launch Xcode, open workspace
0

I had this problem where two remotes appeared when I pressed command 2 in Xcode 10.2.1.

The trick was selecting one of the remotes, then displaying the Inspectors and selecting the Source Control Inspector. It indicated a working copy that was a in a completely different project folder on my disk. This happened with a clone from git in the terminal. The other remote showed the working copy of the expected folder. Somehow, Xcode was finding a reason to find or resolve something to the other folder.

After messing around with Xcode preferences, trying multiple clones, simply renaming the folder of the other working copy to something else solved the problem. Xcode no longer magically tried to add that repo and that working copy to a completely separate clone of the project.

None of the other solutions of looking for DVTSourceControl files, xccheckout, looking in Xcode workspace or project contents, or deleting the Derived Data, lead to the answer. Simply quitting Xcode, locating the other working copy on disk and renaming it and reopening Xcode solved the problem.

Who knows what was happening.

Alex Zavatone
  • 4,106
  • 36
  • 54