Guest User

Untitled

a guest
Jul 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. gbDi() {
  2. git branch --sort=-committerdate | remove-colors | egrep -v "master|\*" | cut -c3- > /tmp/branches && \
  3. cp /tmp/branches /tmp/branches-to-keep && \
  4. vim /tmp/branches-to-keep && \
  5. comm -23 <(sort /tmp/branches) <(sort /tmp/branches-to-keep) | xargs 2> /dev/null git branch -D
  6. }
  7.  
  8. remove-colors() {
  9. sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
  10. }
Add Comment
Please, Sign In to add comment