CDNShark Documentation

Web Hosting

← Back to Documentation

Push to Your Hosting Account with Git

Use your hosting account as a Git remote: git push and the site updates.

1. Generate your Git push password

  1. Open your hosting account → Git.
  2. Under Push over HTTPS, click Generate push password.
  3. Copy it: it's shown once. If you lose it, click New password (the old one stops working).

This password is only for Git; it's separate from your SFTP password.

2. Create an empty repository

  1. Click Create Repository and choose Empty repository (I'll push to it).
  2. Enter a name, the branch to deploy (main), the domain and the folder.
  3. Leave Deploy when I git push to this server ticked if each push should go live straight away.
  4. Click Create.

3. Push

Open the repository's gear icon. It shows the Repository URL, like https://acme@server.cdnshark.com/git/acme/my-site.git, and ready-to-copy commands.

New project:

git init -b main
git add .
git commit -m "First commit"
git remote add origin https://acme@server.cdnshark.com/git/acme/my-site.git
git push -u origin main

Project that already has an origin (for example GitHub): add this server as a second remote with another name.

git remote add cdnshark https://acme@server.cdnshark.com/git/acme/my-site.git
git push -u cdnshark main

Git asks for the password on the first push; enter your Git push password. Your operating system's credential manager can remember it.

When the deploy succeeds, the push output ends with:

remote: CDNShark: deployed main@1a2b3c4 to ~/domains/example.com/public_html

Good to know

  • Only pushes to the deploy branch go live. Other branches are stored but not deployed.
  • With Deploy when I git push off, a push only updates the repository; click Deploy when you're ready.
  • Open the Git tab after pushing and the panel picks up your new commits within a few seconds.
  • You can also git clone the URL on another computer with the same password.
  • 5 wrong passwords within 10 minutes block your IP from the server, including your websites on it, for an hour. Copy the password rather than typing it.