Search code examples
git-submodulescomposer-phpcloudcontrol

Symfony2/Git/CloudControl switching from Composer to Submodules


I need to switch from Composer (which is used by Symfony2 by default) to Git submodules. I thought I could just add the desired submodules to the desired locations, thus overwriting the current version which was installed by Composer.

But when I use git submodule add, it says:

'vendor/twig/twig' already exists in the index

So I tried:

git rm vendor/twig/twig

and tried to add the submodule again, same error.

What am I doing wrong?


Solution

  • The problem was that i had to actually delete and git-remove the repository first.

    i.e. for twig what i did in the end was:

    git rm -r vendor/twig/*
    rm -r vendor/twig/*
    git add vendor/.
    git submodule add git://github.com/fabpot/Twig.git vendor/twig/twig
    git submodule add https://github.com/fabpot/Twig-extensions.git vendor/twig/extensions
    

    Now i have twig and twig extensions as a git submodule and can use it in my cloud application.