0

I am using the answer in this SO posting to create a new local git repository for a project I have taken over from an external developer.

However, when I use the

git add .

command, I get the following error:

fatal: Not a git repository: /Users/XXXXX/Documents/Projects/BirdTrack/BirdTrack/.git/modules/GSJSONSerialization

where XXXXX is the name of the previous developer - not me! Is this a problem with my XCode project, or the GSJSONSerialization file, or something I'm doing wrong? I don't know if XXXXX created the project in XCode with Git enabled or not.

Thanks.

Community
  • 1
  • 1
iaindownie
  • 1,046
  • 12
  • 28

2 Answers2

0

You need to create a new repository first by using git init

The path however looks a bit suspicious ... Are you sure you're in the right place? Looks more like /Users/XXXXX/Documents/Projects/BirdTrack/BirdTrack is the root of your project?

Riri
  • 11,501
  • 14
  • 63
  • 88
  • I did `git init` (as I said I followed the original SO post until the `git add .` command failed). I think you are right that there is something funny with the paths. My project is at `/Users/Iain/Documents/iPhone/BirdTrack`, and I'm issuing the git commands from within this location. – iaindownie Jul 10 '13 at 09:39
  • My commands here: `iain:BirdTrack Iain$ git init Initialized empty Git repository in /Users/Iain/Documents/iPhone/BirdTrack/.git/` `iain:BirdTrack Iain$ git add . fatal: Not a git repository: /Users/XXXXX/Documents/Projects/BirdTrack/BirdTrack/.git/modules/GSJSONSerialization` – iaindownie Jul 10 '13 at 09:47
0

OK, sussed it. There were six folders within the main project directory, and unbeknownst to me, they all had .git folders, previously generated, within them. Simple really. Tip to myself: look for the easy explanation!

iaindownie
  • 1,046
  • 12
  • 28