Skip to content

Instantly share code, notes, and snippets.

@grappler
Created September 19, 2015 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grappler/bc52d5144507e1b123ef to your computer and use it in GitHub Desktop.
Save grappler/bc52d5144507e1b123ef to your computer and use it in GitHub Desktop.

Clone repo

Run following code to clone from GitHub. git clone git@github.com:grappler/WPZOO.git

Install dependencies

Run composer to install the dependencies composer install

Run the following command to install the dependencies without the devlopment plugins composer install --no-dev

Install dependencies

Run composer update to update the plugins. Commit composer.lock to git so that the updates can be saved.

Add remotes

The remote location needs to be added so that it can be pushed to Siteground.

git remote add sg-staging ssh://wpzoo587@am13.siteground.biz:18765/home/wpzoo587/public_html/staging

git remote add sg-prod ssh://wpzoo587@am13.siteground.biz:18765/home/wpzoo587/public_html/prod

Push commits

When the code is pushed to Siteground it will automatically run composer install --no-dev

git push sg-staging develop

git push sg-prod master

Setup repo on Siteground

  • Clone the repo to a folder git clone https://github.com/grappler/WPZOO.git folder_name
  • Checkout the correct branch
  • To be able to push to a non-bare repository you need to execute the following command: git config receive.denyCurrentBranch ignore
  • Create empty file to define production envoirnment e.g. production or staging
  • Setup the post-receive hook
  • Create the post-receive file in folder_name/.git/hooks/. The file encoding should "UTF-8 without BOM" and "UNIX/OSX EOL Format".
  • Paste the contents from https://gist.github.com/grappler/214afd6f861ece80af88 and save.
  • Run chmod +x .git/hooks/post-receive so that the code can be executed.
  • For the first time run composer install --no-dev --prefer-dist --optimize-autoloader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment