Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

git-hashtags

View git-hashtags.rb
1 2 3 4 5 6 7 8 9
#!/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.