Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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
Add Comment
Please, Sign In to add comment