9

When I try to put images into the Resources folder of my project, I get this message:

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

How can I fix it?

6
  • When you created project in XCode4 did you select the option where it would create a local git repository ? Have you committed the project to git ? Have you deleted any git references from the project folder later on ? Commented Sep 12, 2011 at 14:14
  • when i create new project, there is no option named something like : create a local git repository Commented Sep 12, 2011 at 14:45
  • Whats the XCode version you are using? Did you install GIT on your computer, did you add this project to Git ? Have you created this project from scratch or you are working on a copy that someone has created and worked on before Commented Sep 12, 2011 at 15:03
  • My Xcode version is 4.0.2, i am working on this project from scratch, i don't know what is GIT, i was working on the Xcode 3 and i didn't have any problem with that. Commented Sep 12, 2011 at 15:13
  • Hi again, i have found an option named : Create local git repository for this project, shall i select it or not? Commented Sep 12, 2011 at 15:18

5 Answers 5

12

Had the same problem. I copied a project then tried to delete files.

If you want to be able to edit the project, type git init folder in the terminal. This will re-initialize the git in your folder.

Sign up to request clarification or add additional context in comments.

Comments

8

Go to Organizer->Repositories and remove the Corresponding repository.

3 Comments

Thanks, it's the only solution that work for me. My XCode project is on git, but I don't want to use this crappy XCode git feature
I am with you 100% it is buggy.
Yes, but I don't know how can I completely deactivate the Xcode git feature, because it's always coming back..
0

Faced the same problem in Xcode 4.6.1 after moving my folder and xcodeproj file. Here's what works for me:

  1. Delete corresponding repository in Organizer
  2. Close Xcode
  3. Delete the original .git directory
  4. git init in the new directory where you placed the folder and xcodeproj file, and do an initial commit
  5. Start Xcode

Comments

0

In order to do anything in Git, you have to have a Git repository. This is where Git stores the data for the snapshots you are saving.

so just go into your project directory let say you have a project name test_project just go into that directory and type the command

git init

and this will work.

Comments

0

Perform these two steps in Xcode 11, to get rid of this error:

  1. In the menu, select Source Control > Create Git Repositories.
  2. Click on the Create button.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.