Skip to content

Instantly share code, notes, and snippets.

@RPeraltaJr
Last active November 9, 2021 18:30
Show Gist options
  • Save RPeraltaJr/8dc21438ee60ebddba690a93c5d344f8 to your computer and use it in GitHub Desktop.
Save RPeraltaJr/8dc21438ee60ebddba690a93c5d344f8 to your computer and use it in GitHub Desktop.

Git push overview

Please add your SSH public key along with username here. If you need help generating an SSH public key or setting up Git Push integration with WP Engine, please visit this Support Center article

Once you save your key successfully you should be all set! The key will be effectively published in about 10 minutes. To confirm connectivity:

$ ssh git@git.wpengine.com info

Make Updates

On your local computer:

git checkout -b dev  
git add .  
git commit -m "test"
git push

Add Git Remotes Individually

Only needed for first time setup

git remote add production git@git.wpengine.com:production/prodenvname.git   

git remote add staging git@git.wpengine.com:production/stageenvname.git   

git remote add development git@git.wpengine.com:production/devenvname.git   

In the above commands be sure to replace prodenvname, stageenvname, and devenvname with the unique User Portal names of each environment.

You may also rename the “production,” “staging,” and “development” remotes names, if you prefer. We suggest naming them according to their role in your Site to avoid any confusion down the road.

For example:

git remote add mysitename-production git@git.wpengine.com:production/myprodenvname.git

To confirm the remotes were successfully added, use the following command:

git remote -v

This will list all the remotes that were successfully added. Now that the remote endpoints for Git have been established, you can perform a Git push to deploy code changes.

Git Push Deploy

Example:

git push -v remote-name branch-name

To push the production main branch, for example, would look like this:

git push -v production main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment