Error : Fatal: Not a git repository (or any of the

2019-02-17 01:58发布

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

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

How can I fix that?

标签: ios xcode4
4条回答
淡お忘
2楼-- · 2019-02-17 02:40

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
查看更多
The star\"
3楼-- · 2019-02-17 02:42

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

查看更多
再贱就再见
4楼-- · 2019-02-17 02:49

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.

查看更多
再贱就再见
5楼-- · 2019-02-17 02:49

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.

查看更多
登录 后发表回答