Skip to content

Instantly share code, notes, and snippets.

@nicktoumpelis
Created April 23, 2014 13:00
Show Gist options
  • Save nicktoumpelis/11214362 to your computer and use it in GitHub Desktop.
Save nicktoumpelis/11214362 to your computer and use it in GitHub Desktop.
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@mikebeaton
Copy link

mikebeaton commented Sep 16, 2024

Maybe git submodule sync?

For anyone coming new to all these commands, I believe this suggestion is 'as well', not 'instead' (see later comments for what this adds).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment