0

I have a git repository (test-dev) and several dependent git repositories (they are originally managed using composer). Lets call them module-1, module-2

I copied the main git repository to a new location / name (test-deploy) and now want to include those other repositories directly into the new repository.

So I copied the contents of those module repositories into the new test-deploy one.

Now I had some .git files in those subdirectories which I removed. Also the .gitignore files of the sub repositories.

Now I can not add those files anymore to the parent-git.

How can I trace this problem?

EDIT (Clarification):

I only want one single .git - I also do not want to have any gitmodules or something like that.

The final repository should be completely self-contained.

EDIT

From the root of test-deploy:

$ git status
 ...
    nothing to commit (working directory clean)
$ git submodule
No submodule mapping found in .gitmodules for path 'vendor/foo/foo_bar'
Alex
  • 32,506
  • 16
  • 106
  • 171
  • 1
    Don't do that. You need a `.git` folder for each repo. – SLaks Jul 12 '13 at 21:29
  • Additionally, you'll want to ensure that you've maintained your `.gitmodules` during your copy/pasting of repos. – cjc343 Jul 12 '13 at 21:30
  • @SLaks I clarified my question - I want to rip out this .git - the submodules shall not have any .git intelligence any more in this case. – Alex Jul 12 '13 at 21:42
  • @cjc343 see edit --- I did actually not use gitmodules, but composer might have created one – Alex Jul 12 '13 at 21:42
  • @Alex: Then you don't want to use submodules at all. – SLaks Jul 12 '13 at 21:45
  • Don't call them submodules if they're not submodules. If you've already checked them in as submodules, you'll probably need to untrack them before you can track them as folders. – cjc343 Jul 12 '13 at 21:49
  • @cjc343 Good point - edited again. – Alex Jul 12 '13 at 21:53
  • Could you add outputs for `git status` and `git submodule`? – cjc343 Jul 12 '13 at 21:59
  • @cjc343: Edit .. Actually I am redoing it all again now (but do not delete this damaged repo yet) - still it could be interesting to dig why that happened. – Alex Jul 12 '13 at 22:20
  • If you're still interested in pursuing the original issue at all, is there any difference if you run both of those from the root of your repo instead? – cjc343 Jul 12 '13 at 22:48
  • @cjc343: I always like to learn. The above git status / submodules output is from the root of `test-deploy` – Alex Jul 12 '13 at 23:46
  • I didn't really understand what you did (a short example to reproduce it would be nice, I'm a little bit familiar with magento-composer-installer), but: the normal way of handling that error didn't help? http://stackoverflow.com/questions/14720034/no-submodule-mapping-found-in-gitmodules-for-path – Matthias Zeis Jul 13 '13 at 04:44
  • Odd -- what led to my question is the `No submodule mapping found in .gitmodules for path 'vendor/foo/foo_bar'` line, which I thought might be saying you're in the `vendor/foo/foo_bar` directory. It seems there was some partial submodule setup that was causing that message. – cjc343 Jul 15 '13 at 21:06

1 Answers1

0

My workaround (basically I re-did it)

The real cause of the problem is still unclear.

  • First of all do the composer installation (I am using magento-composer-installer) using the deploy strategy copy - otherwise it would create lots of symlinks.
  • Now copy everything
  • But remove the .git
  • Do a new git init
  • Also remove the vendor/ folder - I do not need it in this specific case of mine not any more
  • git add / git commit
Alex
  • 32,506
  • 16
  • 106
  • 171