Skip to content

Instantly share code, notes, and snippets.

@leongaban
Created February 6, 2018 15:50
Show Gist options
  • Save leongaban/8e0114037b4ece75358e4041cb5bd45a to your computer and use it in GitHub Desktop.
Save leongaban/8e0114037b4ece75358e4041cb5bd45a to your computer and use it in GitHub Desktop.

Revisions

  1. leongaban created this gist Feb 6, 2018.
    3 changes: 3 additions & 0 deletions git-prune
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    # Replace REL_BRANCH with the appropriate name

    git fetch --all --prune && git branch --merged | egrep -v "(^\*|REL_BRANCH|master)" | xargs -I % sh -c 'git branch -d %1; git push origin :%1;'