We have the Git client available at Kinsta so you can SSH in and pull your own Git repo down from Github, Gitlab, Bitbucket, or any other third-party. However, we don’t yet have the feature released yet where you can just git push kinsta/my_site
and it automatically gets deployed. This part is coming soon. But you can still easily use Git at Kinsta, just follow the instructions below.
How to Use Git
You can create a deployment script in a few minutes that will SSH into your Google Cloud Linux container and pull down the latest version of your repo. Instead of doing git push kinsta/my_site
and being done, you’ll need to add the following:
git push kinsta/my_site && ssh my_site@1.2.3.4 -p PORT cd /www/my_site/public && git pull
Another way of doing this is to utilize WP Pusher. Many of our clients use this and it makes it super easy! Otherwise, you can follow the more detailed Git instructions below.
Git Instructions
Clone Repo
To clone a repo:
git clone https://github.com/USER/REPO.git
When using Git for private repositories, you use your GitHub username and password which are passed to the server.
git clone https://username:password@github.com/USER/REPO.git
If two-factor authentication is enabled, an OAuth token must be used in place of your standard credentials. Follow these instructions on how to create an OAuth token.
To clone a repo that has 2FA enabled:
git clone https://TOKEN:ANYPASSWORD@github.com/USER/REPO.git
Deploy Repo
To deploy a repo:
git push kinsta/my_site && ssh my_site@1.2.3.4 -p PORT cd /www/my_site/public && git pull
If it’s a private repo, credentials need to be added to the git pull:
git push kinsta/my_site && ssh my_site@1.2.3.4 -p PORT cd /www/my_site/public && git pull https://username:password@github.com/USER/REPO
If two-factor authentication is enabled, an OAuth token must be used in place of your standard credentials. Follow these instructions on how to create an OAuth token.
To deploy a repo that has 2FA enabled:
git push kinsta/my_site && ssh my_site@1.2.3.4 -p PORT cd /www/my_site/public && git pull https://TOKEN:ANYPASSWORD@github.com/USER/REPO
If the git pull above doesn’t contain credentials and the HTTPS path, it will attempt to look locally (rather than at the hosted repo) and throw the message: “Everything up-to-date.”
If you have questions regarding how to use Git at Kinsta our support department will be happy to help once you’re up and running.