Last active
August 31, 2020 16:19
-
-
Save danielgomezrico/6cefbd47fe28d68233ba10c491ee7fab to your computer and use it in GitHub Desktop.
Bash / Git - remove local and remote branches for repo cleanup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# | |
# Remove from local and remotes the branches inside | |
# BRANCHES array | |
# | |
BRANCHES=( | |
branch_1 | |
feature/branch_2 | |
feature/other_thing | |
) | |
for branch_name in ${BRANCHES[*]} | |
do | |
git branch "-d" $branch_name | |
git push origin :$branch_name | |
done | |
git fetch -p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment