Created
June 27, 2017 09:23
-
-
Save resourcemode/4f8296cbbc54a528009267e3490d74b6 to your computer and use it in GitHub Desktop.
Delete git branches using sh script
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
#!/bin/sh | |
## declare an array variable | |
branches=("develop" "master") | |
repositoryPath="/Users/michael.favila/project/trading-platform" | |
## now loop through the above array | |
for i in "${branches[@]}" | |
do | |
echo "$repositoryPath ${i}" | |
cd "$repositoryPath" && git branch -D "${i}" | |
# or do whatever with individual element of the array | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment