Xcode thinks a remote svn repos is git

风格不统一 提交于 2019-12-23 18:27:24

问题


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?


回答1:


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



回答2:


In my case, when i created my project it was using git. But later i removed all git files from my SVN repository. Then took an update. Now, when i tried to add files, it gives me same error.

Solution: I removed all repositories against my project in XCode Organizer. Now when i added new files, it works fine.




回答3:


I had a git and svn against the same project and tried removing the git and got this error

In the end went and manually edited xcshareddata found at and removed all the entries which had anything to do with the git repositoy.

myproject.xcodeproj/project.xcworkspace/xcshareddata



来源:https://stackoverflow.com/questions/7496579/xcode-thinks-a-remote-svn-repos-is-git

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!