# ...meanwhile, in your Capistrano config somewhere: # configure your deployments to always go from the current branch set(:current_branch) { `git branch`.match(/\* (\S+)\s/m)[1] || raise("Couldn't determine current branch") } set :branch, defer { current_branch }