Skip to content

Instantly share code, notes, and snippets.

@byates
Created June 24, 2024 13:05
Show Gist options
  • Save byates/d049f99a8e24cdcaf87752be414a18de to your computer and use it in GitHub Desktop.
Save byates/d049f99a8e24cdcaf87752be414a18de to your computer and use it in GitHub Desktop.

Revisions

  1. byates created this gist Jun 24, 2024.
    9 changes: 9 additions & 0 deletions force-clean-repo.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/bin/bash
    #Cleans and resets a git repo and its submodules
    #https://gist.github.com/nicktoumpelis/11214362
    git reset --hard
    git submodule sync --recursive
    git submodule update --init --force --recursive
    git clean -ffdx
    git submodule foreach --recursive git clean -ffdx