Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode thinks a remote svn repos is git

Tags:

git

xcode

svn

I'm running Xcode 4.1 at work and home. I've successfully checked out a project from a remote svn repository (work) on my home setup. The repos was updated, so when I got home, I did an update on the local checkout.

The status of the updated files got flagged "U" (good) and a page appeared showing changes to accept, but when I hit accept, I get a popup that says:

The working copy "ABRA-D" failed to pull. fatal: Not a git repository (or any of the parent directories): .git

Well, yes... the repo is svn, not git! Closing Xcode and restarting removes the "U" tags and I'm back where I started. Sounds like Xcode is confused about the repo type, though it knew enough to query the svn repo and find out what had been updated. Anyone know a cure?

like image 370
RonC Avatar asked Mar 05 '26 01:03

RonC


1 Answers

That issue, already mentioned in "Error : Fatal: Not a git repository (or any of the parent directories): .git", has a somewhat curious solution described here:

Recently I created a new project and at some point I uploaded it to SVN. I am not quite sure how to reproduce this situation but somehow the versioning support of Xcode 4 decided to interpret the project as a git repository.

Each time I tried to copy a file per drag and drop into my project I got following error:

 fatal: Not a git repository (or any of the parent directories): .git

The result was that the file got copied into the project folder, but the reference didn't get set in the project. I had to go into the folder and drag and drop the file again and uncheck the copy option this time, so that the reference gets set.

The Solution

  1. Open Xcode and go to Window > Organizer
  2. Find under repositories your project. It might be two entries if you use something like SVN.
  3. Make sure it says "Type Git"
  4. Mark the repository entry and hit backspace or delete (on mac)
  5. Done
like image 139
VonC Avatar answered Mar 07 '26 19:03

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!