Github project with capistrano cloning submodules

I am trying to build a capistrano dementoment script for a git project that has a submodule.

I execute these commands

run "git clone git@github.com:GITPROJECT /var/www/myfolder" 

when I run this submodule not cloned into / var / www / myfolder, instead it only creates an empty folder with the name of the submodule

when i try to run this it wont work either

 run "cd /var/www/myfolder/submodule && git pull master" 

can someone help me with this?

+8
git github capistrano
source share
1 answer

Basically you need

 set :git_enable_submodules, 1 

in deploy.rb script. It tells capistrano to initialize and update the git submodules after selecting the source from the main repo. If for any reason you want to do this manually, you can run this from the root directory of your project:

 git submodule update --init 

although, if I remember correctly, --init not available in some older versions of git, so if it doesnโ€™t work, you can do it like this:

 git submodule init && git submodule update 

See this answer for a more detailed explanation of git options for capistrano.

+18
source share

All Articles