Tagging in Git with Ruby

Posted on
#!/usr/bin/env ruby

puts 'Tag version?'
tag = gets.chomp
tag = "v#{tag}" unless tag[0] == 'v'

`git commit -m 'Bump version "#{tag}"'`
`git push origin master`
`git co stable`
`git pull origin stable`
`git merge master`
`git tag "#{tag}"`
`git push origin stable`
`git push --tags`
`git co master`

Source: https://gist.github.com/d19c6bb1d0336db251bf

Leave a Reply

Your email address will not be published. Required fields are marked *