Created
October 27, 2010 11:07
-
-
Save paulccarey/648846 to your computer and use it in GitHub Desktop.
capistrano select git branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :branch do | |
branches=`git branch -r | sed "1 d"`.split | |
branches.map { | b | b.gsub!("origin/","") } | |
puts "What branch would you like to deploy from?" | |
branches.each_index do | i | | |
puts((i+1).to_s + ": " + branches[i]) | |
end | |
branch_index = Capistrano::CLI.ui.ask('Branch to deploy from?:').to_i | |
branches[branch_index-1] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment