1

I have a git clone of a C project, and on that i have my own customized modules, after final modification, i want to make my own stable repository as backup in to github. So when i try to add as below, it fails, because in the child directory there are many .git or .gitignore exist:

Example:

$ ls -a
/var/tmp/me  << main project
/var/tmp/me/folder/main.c
/var/tmp/me/folder/main.h
/var/tmp/me/folder/etcetc.c
/var/tmp/me/folder/.gitignore
/var/tmp/me/folder/.git
/var/tmp/me/another/.git
/var/tmp/me/another/.gitignore
$ sudo git remote add origin git@github.com:me/my.git
fatal: Not a git repository (or any of the parent directories): .git

How do i remove all the previous git repository flags? So that i can apply the git remote add origin?

IBM
  • 97
  • 1
  • 6
  • 2
    I don't buy that that's actual `ls -a` output. Perform your Git commands inside the project directory. – Fred Foo Dec 10 '11 at 21:06
  • @larsmans: I know ls -a is not that but here again shown same as mentioned above: `$ pwd; /var/tmp/me $ sudo git remote add origin git@github.com:me/my.git fatal: Not a git repository (or any of the parent directories): .git` – IBM Dec 10 '11 at 21:09
  • That's not surprising since `/var/tmp/me` is not a Git repo; two of its subdirs are. Do you want to merge those into a single repo? – Fred Foo Dec 10 '11 at 21:12
  • @larsmans: Yes you are very correct. My subdir's are actually the main application. So i want to make a new repository /var/tmp/me << only. As single repo. How can i do that please. – IBM Dec 10 '11 at 21:15
  • 1
    http://stackoverflow.com/questions/1425892/how-do-you-merge-two-git-repositories – Fred Foo Dec 10 '11 at 21:17

1 Answers1

3

I think you can try

git submodule add git@github.com:me/submodule.git
Brook
  • 196
  • 8