Dany Balian
Dany Balian

Reputation: 608

detach all working copies and reset all version history in Xcode 6.3

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:

working copies

commit error

Upvotes: 4

Views: 8324

Answers (7)

Alex Zavatone
Alex Zavatone

Reputation: 4323

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.

Upvotes: 0

Jacob F. Davis C-CISO
Jacob F. Davis C-CISO

Reputation: 890

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

Upvotes: 0

The1Grenade
The1Grenade

Reputation: 31

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!)

Upvotes: 1

Piyush
Piyush

Reputation: 1234

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

Upvotes: 2

coco
coco

Reputation: 3136

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.

Upvotes: 3

Dany Balian
Dany Balian

Reputation: 608

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

Upvotes: 2

david72
david72

Reputation: 7307

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.

Upvotes: 7

Related Questions