title: Pushing all submodules recursively
body: <p>I wrote the below script to push all the changes in the workspace, both in the submodules and the superproject. However, it sounds a little odd that, it is this complex to do what I want. Is there any better way, that I'm missing?</p>
  
  <pre><code>#!/bin/bash
  
  if [ "$#" -ne 1 ]; then
      echo "Illegal number of parameters"
      exit
  fi
  
  SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &amp;&amp; pwd )"
  
  cd "${SCRIPT_DIR}/../submodule1" 
  git status
  git add -A
  git commit -m "$1"
  git push origin master
  
  cd "${SCRIPT_DIR}/../submodule2" 
  git status
  git add -A
  git commit -m "$1"
  git push origin master
  
  cd "${SCRIPT_DIR}/../submodule3" 
  git status
  git add -A
  git commit -m "$1"
  git push origin master
  
  printf "\n\nUpdating Super Project\n\n" 
  cd .. 
  git status
  git add -A
  git commit -m "All Submodules Updated - $1"
  git push origin master
  </code></pre>