Richard Topchii
Richard Topchii

Reputation: 8165

Xcode crashes when working with repository

I have an Xcode project one local and one remote repository. Firstly, there was a problem in current version and I decided to change local repository's head using terminal. Xcode fetched everything and I continued working on the project. When I decided to commit changes, Xcode gave me an error like this: "error: src refspec (detached from ) does not match any.error: failed to push some refs to [repository address]". After, I decided to create a new remote repository and try to make initial commit of this project. I added remote to Xcode and now it crashes even if I open "remotes" tab. I use bitbucket as my remote repo.
Question: is it possible to fix this, or it is easier to copy all the contents of the project to another one and commit new one? Thanks for replies.

Upvotes: 1

Views: 1596

Answers (2)

us_david
us_david

Reputation: 4917

I had the same problem: the local git repo was created from command line (from terminal app) and not from within Xcode, Xcode would crash every time even when clicking on the remote tab. I have a different solution that may be easier:
1)Commit and Push all changes with your current project from your local Xcode-non-compatible repo
2) Re-open Xcode (close it if it's open) and select "Check out an existing project" from Xcode Select Checkout

*If you don't see this Xcode startup screen, go to Source Control->Check Out...
3)Select the remote repo then
Select remote repo

4)Select a NEW directory for the checkout destination
enter image description here

Now you will have a project set up and compatible with Xcode!

Upvotes: 1

Richard Topchii
Richard Topchii

Reputation: 8165

Solved:
Create new empty project, then copy all the files from previous one. Create new repository, absolutely clean. Push there.
It seems that Xcode had a conflict when local repository's head was changed using command line and git. So, this is as warning for users who got the same situation.

Upvotes: 0

Related Questions