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

放肆的年华 提交于 2019-12-19 06:29:51

问题


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?


回答1:


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.




回答2:


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




回答3:


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



回答4:


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.




回答5:


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.


来源:https://stackoverflow.com/questions/7388560/error-fatal-not-a-git-repository-or-any-of-the-parent-directories-git

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