Cloning a Github Repo

This content is password protected. To view it please enter your password below:

Make sure that your github account has the server SSH key linked to it.

On the Github repo click on “Clone or Download” and then copy the SSH link (click “Use SSH” if it is showing the https:// link).

On the server (either SSH in or use terminal on the server site), CD into the location you want to clone the repo (for WP sites: wp-content/themes, for non-WP just public_/html)

For WP use the clone command with the SSH key:
git clone

If you are cloning into the public_html add a fullstop at the end, to say that you want to close into this folder not create a folder in this location:
git clone .
The public_html has to be empty for this to work so if it’s an existing site i just add the htacess to the github repo and then delete everything in the folder before cloning.

To update these from github you just CD into the repo on the server and use the command:
git pull origin master

Origin is the location (i.e. github), master is the branch (so if you want to pull from a separate branch then replace this)

Twentytwo Digital

General updates from the team.