Skip to content

Instantly share code, notes, and snippets.

@karuppasamy
Created July 25, 2016 04:20
Show Gist options
  • Select an option

  • Save karuppasamy/591d484b4211636785ac16d5e19c7f6b to your computer and use it in GitHub Desktop.

Select an option

Save karuppasamy/591d484b4211636785ac16d5e19c7f6b to your computer and use it in GitHub Desktop.

Revisions

  1. karuppasamy created this gist Jul 25, 2016.
    2 changes: 2 additions & 0 deletions git-delete-remote-branch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    # Delete remote branches except `master` and `development`
    git branch -r --merged | grep origin | grep -v '>' | grep -v master | grep -v development | grep -v sprint | xargs -L1 | cut -d"/" -f2- | xargs git push origin --delete > ~/Documents/remote_branch