Instantly share code, notes, and snippets.

What would you like to do?

Clone repo

Run following code to clone from GitHub. git clone

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://

git remote add sg-prod ssh://

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 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 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