Git trick: Push any branch to master

by Anton Zolotov · 0 comments

For each Rails application we develop, we usually have a staging and a production app on heroku. Heroku requires you to push to master, but what if you are working on the “dev“ branch, and want to push from there?

The command looks like this:

git push remote local_branch:remote_branch

So we do

git push staging dev:master

And we’re done.

Heroku also has an excellent article on how to manage multiple environments: http://devcenter.heroku.com/articles/multiple-environments. Check it out, it’s worth a read.

Share
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • email
  • HackerNews
  • StumbleUpon

Leave a Comment

Previous post: