Skip to content

Instantly share code, notes, and snippets.

@y0za
Created June 9, 2016 01:08
Show Gist options
  • Select an option

  • Save y0za/6a596252846f53f18a05c6dc39ef2b3d to your computer and use it in GitHub Desktop.

Select an option

Save y0za/6a596252846f53f18a05c6dc39ef2b3d to your computer and use it in GitHub Desktop.
bulk delete git remote old branches
git for-each-ref --merged origin/master refs/remotes --format='%(committerdate:short) %(refname:short)' | awk '$1<"2006-01-02"{print substr($2, 8)}' | xargs git push origin --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment