Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Git 2 svn : create tag
# set -x
for t in `git tag` ; do git tag -d $t > /dev/null ; done
for branch in `git -c "color.ui"=false branch -r`; do
if echo "$branch" | \grep -v "^tag" 2>&1 >/dev/null ; then
tag=`echo $branch | sed -e 's/.*_/v/' -e 's/.*v/v/'`
commit=`git log -1 --pretty="%H" remotes/$branch | cat`
message=`git log -1 --pretty="%s" remotes/$branch | cat`
previous_commit=`git log -1 --pretty="%H" $commit^ | cat`
git tag $tag -a -f -m "$message" $previous_commit > /dev/null
echo 'Good'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.