Mario. Web Developer, Snowboarding Addict

Git reset submodules

I'm managing a large number of git submodules on a particular project, and found their working directories often became dirty in various ways (i.e. file perms changing with an Aegir deployment).

Found the handy 'git submodule foreach' command can be used to reset them all in one fell swoop:

git submodule foreach 'git reset --hard'
Tags:  git tidbit

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <div> <h3> <h4>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <drupal5>, <drupal6>, <javascript>, <php>, <text>.
  • Web page addresses and e-mail addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.