shannoga
shannoga

Reputation: 19869

"Not a git repository: " Error when trying to add RestKit to my repository

I am trying to start using git with my project.

I had (in the past) cloned RestKit to my project for use (I think that as a submodule but I am not sure. Now everything is working great and 99% of my files are tracked and pushed to Github.

When I try to add RestKit/ to my repository I get this error:

shanis-imac:shannoga-English-Club shannoga$ git add RestKit/ fatal: Not a git repository: /Users/shannoga/github/shannoga-English-Club/.git/modules/RestKit

Now I can guess that I am not spoused to push rest kit but somehow to relate it to my repository?

  1. Am I right?
  2. What does the error mean
  3. What is the way to do that?

Thanks, Shani

Upvotes: 2

Views: 934

Answers (1)

VonC
VonC

Reputation: 1323983

If ResKit is already declared as a submodule in your current GitHub project, you shouldn't have to clone it / add it directly (not git add should be involved).

Following Git Tools - Submodules, you should:

git submodule init
git submodule update

That will fetch all the data from that project and check out the appropriate commit listed in your superproject.

A git clone --recursive of your main project would have included this step for you: see "How do I get git clone --recursive to recreate submodules' remotes and branches?", and don't forget, as explained in that last SO question, that the submodules are checked out in a detached HEAD mode.

Upvotes: 1

Related Questions