Guest User

Untitled

a guest
Jul 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2. commit =`git log -n 1 --oneline`
  3. commit =~ /^([a-z0-9]+).+?#([A-Za-z0-9\._-]+)(?:$| )/
  4. sha,tag = $1,$2
  5. if tag
  6. `git tag #{tag} #{sha}`
  7. commit_without_tag = commit.gsub(/#{sha}/,'').gsub(/##{tag}/,'').strip
  8. `git commit --amend -m "#{commit_without_tag}"`
  9. end
Add Comment
Please, Sign In to add comment