Stash everything in Git including all submodules?

When a project contains submodules you need to stash/unstash all of them separately. Is there a way to do it using less actions?

This link maybe helpful:

  • Integrate TFS git source control and JIRA
  • Script to remove commits older than date specified
  • Why is the meaning of “ours” and “theirs” reversed with git-svn
  • Git: Export MySQL database on commit?
  • How to detect differences between local repo and remote repo in git?
  • Git push error: does not match your user account
  • Easy way pull latest of all submodules

    It is about “pull” command but there are some ways how to iterate between all the submodules.

  • JGitFlow maven plugin doesn't push release branch to remote
  • How do I configure Visual Studio 2013 for use with Git/SourceTree
  • GIT - Managing two branches at once? Merge at some point?
  • Best way to update database structure on production server?
  • Is there a way to force a commiter enter their username in git bash
  • Everythings up to date (everything-isn't)
  • One Solution collect form web for “Stash everything in Git including all submodules?”

    You can use foreach to run a specific git command on each sub-module. For example to apply ‘git stash’ to every modules use this:

    git submodule foreach 'git stash'

    Similarly, the following command will checkout master branch and then pull any updates from the remote source for each submodule.

    git submodule foreach 'git checkout master; git pull'

    Read more at:

    Git Baby is a git and github fan, let's start git clone.