Git workflow with submodules for Drupal deployment

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 commiting it, we go back to the contrib folder and do:

git add contrib-module-name 

At the end, 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:// 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



Add new comment | Penyaskito Blog

What i do not understood is actually how you're no longer
really much more smartly-liked than you may be right now.
You are so intelligent. You realize therefore considerably in the case of this subject, produced me personally believe it from a lot of varied
angles. Its like men and women are not fascinated unless it is one thing to accomplish with Lady gaga!
Your individual stuffs outstanding. All the time handle
it up!

Stop by my page: <a href="">website hosting companies</a>

Add new comment | Penyaskito Blog

Hi there! I know this is somewhat off-topic however I needed to ask.
Does running a well-established blog like yours take a larrge amount
of work? I am completely new to blogging but I do write in my diary daily.
I'd like to start a blog so I will be able to share my experience and views online.
Please let me know if youu have any kind of
ideas or tips for new aspiring blog owners. Appreciate it!

Visi my web blog ... sexual assault investfigation training
massachusetts - <a href=",

Add new comment | Penyaskito Blog

What i don't understood is if truth be tood how you are now not really much more well-liked than you may be right now.
You are very intelligent. You realize therefore significantly in terms of
this subject, made me personally imagine iit from
a lot of varied angles. Itts like men and women are not involved except it's something to do with Girl gaga!

Your individual stuffs excellent. All the time take care of it up!

Also visit my blog; <a href="">woodworking plans for toy trucks</a>


Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
To prevent automated spam submissions leave this field empty.
By submitting this form, you accept the Mollom privacy policy.