Deploy using Git

Requirements

You need to have a git repository initialized on the server and a local copy of it as described in Local development.

You need to be in your project directory: cd ~/Projects/your-site/

You need to have production set as git remote:

# Here we are using custom alias 'your-site' in ~/.ssh/config$ git remote -v
production your-site:/data/wordpress/.git (fetch)
production your-site:/data/wordpress/.git (push)# This is the output if project was cloned without ssh alias$ git remote -v
production ssh://your-site@your-site.seravo.com:12345/data/wordpress (fetch)
production ssh://your-site@your-site.seravo.com:12345/data/wordpress (push)

Deploy using git

Note: This doesn’t deploy database or uploads. We recommend that you don’t include these in git.

Step 2 - Setting credentials

Note: This is just an example. Use the real credentials for your site.

Step 3 - Push into production

# First push doesn't share anything with the fresh site so you need to force push it$ git push production master --force

For deploying the database contents or the uploads folder you need to roll your own solution which is safe enough to not overwrite any data created in production.

Note on wp-push- commands:
In Seravo Vagrant images created before October 5th, 2016, there used to be the commands wp-push-production-db (deploy database to production) and wp-push-production-uploads (deploy wp-content/uploads into production) but they were deemed as too risky and removed to protect customers from accidentally making too much damage to their site.

Developer documentation for Seravo.com – if you find flaws, please contribute a fix on GitHub!