# first remove your copy and paste plugin….
git rm -r vendor/plugins/xxxxxx git commit
now you are ready to add the submodule
git submodule add git://your_git_repo/xxxxx.git vendor/plugins/xxxxx git commit
To load the submodule, you need to
git submodule init git submodule update
To deploy submodules using capistrano, capistrano needs to also do the submodule init and update.
# in deploy.rb set :git_enable_submodules,1
if you want to update the version of the submodule – or the branch
cd into the plugin, git pull or git checkout branch
then cd back to the containing project and git commit
Tags: git rails
You can also use the “-b ” flag with “git submodule add” to get the desired branch out of the box.
Hi, thanks for your article.
Can you explain what extra benefits can I get while using git submodules?
Yes – I thought I should be a little more verbose – The benefits
Thanks for your explanation!
I should start looking more closely at git submodules.