Skip to content

Instantly share code, notes, and snippets.

@tmcolby
Last active September 23, 2020 20:34
Show Gist options
  • Save tmcolby/85ca4360b2d22cd3fdf8372735e545af to your computer and use it in GitHub Desktop.
Save tmcolby/85ca4360b2d22cd3fdf8372735e545af to your computer and use it in GitHub Desktop.
git reset to master including submodules

git reset --hard HEAD
git clean -f -d
git checkout master
git fetch origin master
git reset --hard origin/master
git pull
git submodule update
git submodule update --init --recursive
git submodule foreach git reset --hard HEAD
git submodule foreach git clean -f -d
git submodule foreach git submodule update --init --recursive
git submodule foreach git fetch
git submodule foreach git pull
git status

credit: https://stackoverflow.com/questions/4327708/git-reset-hard-head-leaves-untracked-files-behind

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