The result of following setup is on github: hi-ogawa/wordpress-revisr.
Ignore all but theme files
Here is a
.gitignore file only for tracking changes on
* !/wp-content/ /wp-content/* !/wp-content/themes/ /wp-content/themes/* !/wp-content/themes/simple-mag/ !/wp-content/themes/simple-mag/*
Setup remote repository
I didn't want to hard-code my password for remote repository https url. So, I tried ssh version of url.
Here is a screenshot of Revisr setting:
First, generate ssh private/public keys for user
$ sudo mkdir /var/www/.ssh $ sudo chown www-data:www-data /var/www/.ssh $ sudo su - www-data -s /bin/bash -c ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/var/www/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /var/www/.ssh/id_rsa. Your public key has been saved in /var/www/.ssh/id_rsa.pub. ...
Second, save generated public key to github repository as deploy key:
Then, make sure connection is fine. Here I had a problem, so I'll show my workaround:
# it fails for some reason I don't know $ sudo su - www-data -s /bin/bash -c 'ssh -T email@example.com' Host key verification failed. # that's why I forced to add github.com as known host $ sudo su - www-data -s /bin/bash -c 'ssh -o StrictHostKeyChecking=no -T firstname.lastname@example.org' Warning: Permanently added 'github.com,126.96.36.199' (RSA) to the list of known hosts. Hi hi-ogawa/wordpress-revisr! You've successfully authenticated, but GitHub does not provide shell access. # then it's fine for all $ sudo su - www-data -s /bin/bash -c 'ssh -T email@example.com' Hi hi-ogawa/wordpress-revisr! You've successfully authenticated, but GitHub does not provide shell access.