Github and WPEngine setup

WP Engine has it's own git server that it's build in. However, we use Github as well. Here are some tips on how to work with both of them:

  • If you're new in Git, first thing that you should do is generating public key. Complete documentation about how to do that can be found here
  • You also need to remember about setting correct username and email address
  • Next, connect your public key with Github. This can be done on settings page
  • Now you can get the repo from Github. In order to do that you need to get repository SSH address, that is available in repository page in Github ("SSH clone URL" in a right hand column)
  • To clone the repository, run following command on your local machine:
    $ git clone [email protected]:makingwaves/repo-name.git
    
  • Above command will create repo-name folder. Go into it and run git status to get sure that you have a correct git repo installed Now, the WP Engine part. Log into https://my.wpengine.com and go to 'Git Push' page for the project you want to set up. That's a place where you need to add a public key that you generated before. After adding it, key will be enabled in about 10 minutes.
  • Back to your local console and add references to WP Engine repository. This can be done by running the commands:

Staging

$ git remote add staging [email protected]:staging/repo-name.git

Production

$ git remote add production [email protected]:production/repo-name.git
  • Running command git remote -v you can see that your local repository is now set up to work with three servers: origin (Github), production and staging
    $ git remote -v
    production  [email protected]:production/repo-name.git (fetch)
    production  [email protected]:production/repo-name.git (push)
    staging  [email protected]:staging/repo-name.git (fetch)
    staging  [email protected]:staging/repo-name.git (push)
    

Important to remember

Make sure to add a gitignore file that ignores the wp core files. An example can be found here

Source: At long last… Deploy your WP Engine hosted application with the ease of Git

results matching ""

    No results matching ""