Skip to content

Instantly share code, notes, and snippets.

@rkdgusrnrlrl
Created February 10, 2023 01:21
Show Gist options
  • Save rkdgusrnrlrl/d851937f336a86f2f0b1ff9355a8cbac to your computer and use it in GitHub Desktop.
Save rkdgusrnrlrl/d851937f336a86f2f0b1ff9355a8cbac to your computer and use it in GitHub Desktop.
git for-each-ref refs/heads/ --count=10 --format='%(refname:short)' --sort=committerdate | grep users
echo "delete that branches(y/n): "
read name
if [ $name == 'y' ]; then
git for-each-ref refs/heads/ --count=10 --format='%(refname:short)' --sort=committerdate | grep users | xargs git branch -D
echo "deleted branches"
else
echo "cencel delete branches"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment