Skip to content

@ashaw /git-hashtags.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
git-hashtags
#!/usr/bin/env ruby
commit =`git log -n 1 --oneline`
commit =~ /^([a-z0-9]+).+?#([A-Za-z0-9\._-]+)(?:$| )/
sha,tag = $1,$2
if tag
`git tag #{tag} #{sha}`
commit_without_tag = commit.gsub(/#{sha}/,'').gsub(/##{tag}/,'').strip
`git commit --amend -m "#{commit_without_tag}"`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.