Skip to main content
Penyaskito Blog

Main navigation

  • Home
Language switcher
  • English
  • Español
User account menu
  • Log in

Breadcrumb

  1. Home

Git workflow with submodules for Drupal deployment

By penyaskito , 24 September, 2012

Maybe you've seen the great article on Drupal Deployment with Git Submodules, by Randy Fay. I manage this site using that strategy, but some times I forget how every operation is done. So here I'm collecting them for my own reference.

For fetching all the new info from submodules: 

git submodule foreach git fetch origin

Now we go into each module folder and use:

git pull 

If we wanted to switch to a different branch, we should use:

git branch -a # we see the available branches 
git checkout 7.x-2.x # the different branch 

For committing it, we go back to the contrib folder and do:

git add contrib-module-name 

Then, we use:

drush updb --debug -y 

Maybe we see some warnings because of unresolved dependencies. In that case, add the new submodule:

git submodule add --branch 7.x-1.x git://git.drupal.org/project/entity.git sites/all/modules/contrib/entity 

Finally, updating core:

git merge drupal/7.x drush updb --debug -y 

Ok, so we've done this on our DEVELOPMENT site. If everything is OK, now it's time to update the server, after doing a backup:

git pull
git submodule update --init 
drush updb --debug -y

Tags

  • git
  • git submodules
  • workflow
  • Drupal

Monthly archive

  • April 2026 (4)
  • August 2025 (1)
  • April 2025 (1)
  • July 2023 (1)
  • December 2021 (1)
  • May 2021 (2)
  • April 2021 (1)
  • September 2014 (1)
  • November 2012 (1)
  • September 2012 (2)
  • August 2012 (3)
  • June 2012 (6)

Recent content

Your SKILLs don't matter: deterministic checks do
10 hours 3 minutes ago
Droople Reader, my new way of consuming RSS feeds
5 days 12 hours ago
How I keep up with changes in Drupal
1 week ago

Recent comments

That's a great idea! I would…
7 hours 52 minutes ago
D.org integration
3 days ago
Can't blame you 😜For me…
4 days ago

Blogs I follow

  • Mateu Aguiló "e0ipso"
  • Gábor Hojtsy
  • Pedro Cambra
  • The Russian Lullaby, davidjguru
  • Can It Be All So Simple
  • Maria Arias de Reyna "Délawen"
  • Matt Glaman
  • Daniel Wehner
  • Jacob Rockowitz
  • Wim Leers
  • Dries Buytaert
  • arcturus
  • Drupal Core AI digest
  • Drupal CMS AI digest
  • Drupal Canvas AI digest
  • Drupal AI AI digest
  • Drupal Patterns AI digest
  • Trisha Gee
  • Très Bien Tech, by _nod
  • Moshe Weitzman
  • Drupal core change records
  • Ed Zitron's Where's Your Ed At
Syndicate

Footer

  • Drupal.org
  • LinkedIn
  • GitHub
  • Mastodon
  • Twitter
Powered by Drupal

Free 🇵🇸