Skip to content

Instantly share code, notes, and snippets.

@cjsteel
cjsteel / Staging&ProductionUsingGit.md
Last active April 10, 2024 16:23 — forked from mediabeastnz/Staging&ProductionUsingGit
Staging and Production Server using Git.

If you are running a large project such as a website or ansible server you will want to test new features before pushing them into production then something like the following setup may work for you.

For this example imagine your url is mysite.ca and you want a development/staging site on a subdomain which is dev.mysite.ca

Setup

For websites

Create the website's domain and subdomain

@mediabeastnz
mediabeastnz / Staging&ProductionUsingGit
Last active December 1, 2022 14:47
Staging and Production Server using Git.
If you are running a large website where you will need to test new features on a seperate url before pushing them live then the following instructions are for you ;)
For this example imagine your url is apple.com and you want a development/staging site on a subdomain which is dev.apple.com
#Setup#
1. First thing you'll want to do is go ahead and create your website in plesk and add the subdomain dev.apple.com at the same time.
2. ssh into the server e.g. $ ssh username@ipaddress
3. Once logged in cd into the private directory (this will be where all git repos are stored) e.g. $ cd ~/private
4. Create the main repo e.g. $ git init --bare apple.git
5. Now to clone this new repo on your local machine. $ git clone ssh://username@ipaddres/~/private/apple.com