Skip to content

Instantly share code, notes, and snippets.

@lucas-manuel
Forked from nicktoumpelis/repo-rinse.sh
Created December 15, 2021 18:25
Show Gist options
  • Save lucas-manuel/dd125852331c46682a529397ec6c4e4e to your computer and use it in GitHub Desktop.
Save lucas-manuel/dd125852331c46682a529397ec6c4e4e 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
@sambacha
Copy link

sambacha commented Jul 6, 2022

git config --global alias.rinse '!git submodule foreach --recursive git clean -xfd && git submodule sync --recursive && git restore . --recurse-submodules'

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