Created
December 15, 2016 15:25
-
-
Save paultyng/28c915d6d4a7b4453828c21cbc748028 to your computer and use it in GitHub Desktop.
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/bash | |
remote="${1:-origin}" | |
echo "Using remote $remote" | |
branches="$(git ls-remote --heads $remote | awk '{print $2}' | awk -F'/' '{print $3}' | grep '^v' | sort | uniq)" | |
echo "$branches" | while read branch; do | |
echo "Branch: $branch" | |
git checkout "$remote/$branch" | |
git tag -f -a "$branch" -m "$branch" | |
done | |
git checkout master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment