My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

mfclean 1008B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. #
  3. # mfclean
  4. #
  5. # Prune all your merged branches and any branches whose remotes are gone
  6. # Great way to clean up your branches after messing around a lot
  7. #
  8. KEEP="RC|RCBugFix|dev|master|bugfix-1"
  9. echo "Fetching latest upstream and origin..."
  10. git fetch upstream
  11. git fetch origin
  12. echo
  13. echo "Pruning Merged Branches..."
  14. git branch --merged | egrep -v "^\*|$KEEP" | xargs -n 1 git branch -d
  15. echo
  16. echo "Pruning Remotely-deleted Branches..."
  17. git branch -vv | egrep -v "^\*|$KEEP" | grep ': gone]' | gawk '{print $1}' | xargs -n 1 git branch -D
  18. echo
  19. # List fork branches that don't match local branches
  20. echo "You may want to remove (or checkout) these refs..."
  21. comm -23 \
  22. <(git branch --all | sed 's/^[\* ] //' | grep origin/ | grep -v "\->" | awk '{ print $1; }' | sed 's/remotes\/origin\///') \
  23. <(git branch --all | sed 's/^[\* ] //' | grep -v remotes/ | awk '{ print $1; }') \
  24. | awk '{ print "git branch -d -r origin/" $1; print "git checkout origin/" $1 " -b " $1; print ""; }'
  25. echo