Skip to content

Instantly share code, notes, and snippets.

@doniz
Last active September 18, 2018 07:13
Show Gist options
  • Save doniz/47a856a49e56e30b0e66ed5303d31556 to your computer and use it in GitHub Desktop.
Save doniz/47a856a49e56e30b0e66ed5303d31556 to your computer and use it in GitHub Desktop.
delete git local branches from file
# put branch list to file "git branch -l | grep some-filter-text > branch-list.txt"
# serve branch list from file
BRANCHES=$(cat branch-list.txt)
for BRANCH in $BRANCHES; do
git branch -d $BRANCH -f;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment