Skip to content

Instantly share code, notes, and snippets.

@Masynchin
Created June 12, 2022 23:37
Show Gist options
  • Select an option

  • Save Masynchin/e86cc524c16a7063f3f98c45d0987b73 to your computer and use it in GitHub Desktop.

Select an option

Save Masynchin/e86cc524c16a7063f3f98c45d0987b73 to your computer and use it in GitHub Desktop.

Revisions

  1. Masynchin created this gist Jun 12, 2022.
    4 changes: 4 additions & 0 deletions exceptmain.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # Shamelessly stolen from https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/delete-all-branches-except-master-main-local-remote
    # using ripgrep instead of grep, so it is two symbols shorter :)

    git branch | rg -v 'main' | xargs git branch -D