views:

193

answers:

1

Hi, I've read a couple of the other posts on this issue, but seemed to be stumped on something. I'm trying to have two separate branches that push out to two different Heroku instances - one production and one staging. I suppose my setup will look as follows:

Local          Myapp
|            |
- master  >  - master
|            |
|            | Myapp-Staging
|            |
- edge    >  - master

I have the following commands, but for some reason I don't seem to be able to push to the staging service correctly. "git push staging master" goes through, but I can't figure out why the changes don't seem to be getting reflected on the Heroku instance when I go to myapp-staging.heroku.com. I might be doing something sill here...

[Dev]

git checkout edge
git push staging master (is this "master" or "edge")?
heroku rake db:migrate --app myapp-staging

[Production]

git checkout master
git push master master
heroku rake db:migrate -app myapp

Any help would be tremendously appreciated.

+4  A: 

Try:

git push staging edge:master

Staging is the remote repository, and you're pushing your "edge" branch to "master" branch on "staging" repository.

(git push staging master is a shortcut for git push staging master:master.)

Also you don't need to checkout your code before pushing. You can push arbitrary branch to any server - no matter what branch is checked out.

Wojciech Kruszewski