Skip to content

Instantly share code, notes, and snippets.

@joonas
Created February 9, 2013 02:52
Show Gist options
  • Save joonas/4743628 to your computer and use it in GitHub Desktop.
Save joonas/4743628 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
VERSION_TAGS=$(git log --pretty=oneline --grep '[0-9]$' \
--branches=origin/remote -- www/version.txt | cut -d ' ' -f1)
for commit_hash in $VERSION_TAGS
do
version=$(git show $commit_hash:www/version.txt)
git tag $version $commit_hash
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment