Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 224563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:19:42+00:00 2026-05-11T19:19:42+00:00

I recently turned a couple of my plugins into submodules and realized that when

  • 0

I recently turned a couple of my plugins into submodules and realized that when you “git clone” a repository, the submodule directory will be empty. This makes sense for co-developers to initialize their submodules and update.

However, when I deploy with capistrano the submodule code will obviously not be deployed which causes problems. I could go into the release branch and init and update the module there, but that is obviously not an ideal solution.

Does anyone have suggestions about how to handle this? Is it as simple as a capistrano task?

I am a bit of a noob on the production side of things.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:19:43+00:00Added an answer on May 11, 2026 at 7:19 pm

    According to this recent thread, capistrano should be able to init and update your submodules:

    set :git_enable_submodules,1
    

    in config/deploy.rb should be enough, if your .gitmodules entries are up to date.
    You may need to patch Capistrano (lib/capistano/recipes/deploy/scm/git.rb) to make sure your submodules get included though.

        def checkout(revision, destination)
          git      = command
    
          branch   = head
    
          fail "No branch specified, use for example 'set :branch, \"origin/master\"' in your deploy.rb" unless branch
    
          if depth = configuration[:git_shallow_clone]
            execute  = "#{git} clone --depth #{depth} #{configuration[:repository]} #{destination} && " 
          else
            execute  = "#{git} clone #{configuration[:repository]} #{destination} && " 
          end
    
          execute += "cd #{destination} && #{git} checkout -b deploy #{branch}" 
    
          if submodules = configuration[:git_enable_submodules]
            execute += " && git-submodule init &&" 
            execute += "git-submodule update" 
          end
    
          execute
        end
    

    If you have nested submodules, you need:

    gem sources -a http://gems.github.com
    $ sudo gem install morhekil-capistrano-deepmodules
    

    Just require it at your deployment config:

    require ‘capistrano/deepmodules’

    The gem will take care of all the rest automatically.
    You can delete :git_enable_submodules from your config, the gem pays no attention to it – if you’re requiring it you’re already saying that you want to enable submodules.

    And one more detail to pay attention to – at the moment only remote cache strategy is supported by the gem. It means that you MUST add to your config the following line:

    set :deploy_via, :remote_cache
    

    It enables the remote cache and it’s really the thing you want to do anyway – deploying large codebases with a lot of submodules and other stuff is really a troublesome experience if you have no server-side cache of it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently encountered a printing issue in Firefox that eventually turned out to be
Recently we turned a set of complicate C# based scheduling logic into SQL CLR
I recently turned an old Joomla site into a Wordpress site and I want
I recently spent a long while debugging something that turned out to be an
I recently turned on Windows Firewall logging on my computer and started tracking incoming
I've got 80,000 users on my site and i've recently turned away from the
I have switched to Vista recently and I wanted to keep UAC turned on,
Recently I bumped into a problem where my OpenGL program would not render textures
Recently, I read a post on Stack Overflow about finding integers that are perfect
I've recently implemented a couple of similar-sized web applications, one of which used a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.