2

I'm adding a new project to a new Git repository.

I did git init, and when I do git add . it says :

fatal: Not a git repository: MyProject-iOS/Frameworks/AFNetworking.git/../../../.git/modules/MyProject-iOS/Frameworks/AFNetworking.git

Framework structure is very strange in the project, I inherited it from someone else.

What to do and how to fix this?

Rivera
  • 10,792
  • 3
  • 58
  • 102
Dvole
  • 5,725
  • 10
  • 54
  • 87

1 Answers1

7

It seems that:

The easiest way out of this is:

  • clone again the main repo (followed by a cd mainrepo; git submodule update --init --recursive)
  • inside, to "add new projects", use git submodule add /url/repo/new/project, instead of git init/git add, if you want to consider those projects as submodules of the main parent repo.
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I'm guessing this was third-party source they published by simply deleting a clone's `.git` directory and OP's making a repo for his own use. Publishers forget to strip the submodule's gitfile is all that has to happen to get this symptom then. – jthill Aug 03 '14 at 04:15