Skip to content

Instantly share code, notes, and snippets.

@garaemon
Last active August 29, 2015 13:57
Show Gist options
  • Save garaemon/9594583 to your computer and use it in GitHub Desktop.
Save garaemon/9594583 to your computer and use it in GitHub Desktop.
a script to fix tags of jsk repos
#!/bin/bash
TAGS="cturtle diamondback fuerte electric"
for tag in $TAGS
do
if [ `git tag -l $tag` ]; then
hash=$(git log -1 --format="%H" --until="$(git show $tag --pretty=%ci -s | tail -n 1)")
if [ "$hash" != "" ]; then
echo "$tag -> $hash"
git tag -f $tag $hash
else
echo "no valid commit for $tag"
fi
fi
done
git gc
git prune --expire now
du -h .git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment