1

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.

Richard Topchii
  • 7,075
  • 8
  • 48
  • 115

2 Answers2

1

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!

us_david
  • 4,431
  • 35
  • 29
  • May be a good idea. Im not sure, if would it work for me, cause I had different Xcode version at that moment. Should we raise an bug report to Apple, based on this topic? – Richard Topchii Nov 05 '14 at 21:10
  • 1
    I would think so. It's consistently crashing if the git repo is not created by Xcode. I have tried Xcode 5 & 6. They all crash when one tries to access the remote git repo. – us_david Nov 06 '14 at 01:59
0

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.

Richard Topchii
  • 7,075
  • 8
  • 48
  • 115