0

I am using WP Engine's git deploy and have just completed work on a feature that I pushed to the WPE git repo for deployment to staging servers.

I would like to view those changes for various reasons like QA and client approval.

Now that my feature branch is pushed how can I switch branches only on the remote server. I don't want to clone it or download the branch in any way, just be able to view it online.

Locally, I would do git checkout my-feature-branch but I'm not sure on remotes.

Josh Smith
  • 345
  • 2
  • 5
  • 24

1 Answers1

0

If I understood correctly you want to have feature-branch deployed? I don't know WP Engine, but looking at the docs you can deploy with a:

git push production master

If you want to push a specific branch to WP Engine, just do:

git push -f production feature-branch:master

Be aware that this will override whatever WP Engine has on the servers as master.

Note:

If you don't have a staging environment where to try your changes and you don't want to overwrite your production, one solution is to use feature switches and merge your changes into master.

In PHP you could use for example a conditional block with the new code inside, that gets activated when you pass &feature=myfeature as a URL parameter.

aledalgrande
  • 5,167
  • 3
  • 37
  • 65
  • Yes, you do understand me correctly but that is not working for me. I don't want to change what is `master` I only want to switch to my `feature` on the server, the same way I can `git checkout feature` on my local machine and see the changes in my browser. `git checkout master` and everything is back to normal. – Josh Smith Aug 23 '15 at 02:11
  • I don't think you will ever have that kind of access to WP Engine servers. You cannot remotely switch the branch that _their_ server is using to make your app run. – aledalgrande Aug 23 '15 at 02:24