Knowledgebase

Using Git on Your Hosting Account Print

  • developersgitdeployment, developers, webhosting, uploads, cpanel, ftp, caching, guide
  • 0

Version control on the server.

AVAILABILITY

Git is available on most accounts with SSH access. cPanel also provides Git Version Control in the interface.

CHECKING

Run git --version over SSH. If it responds, you have it.

THE COMMON WORKFLOW

Develop locally, commit, push to a remote repository such as GitHub, then pull on the server.

The server holds a clone of the repository, and deployment is a pull.

CLONING A REPOSITORY

From SSH, clone into the appropriate directory. For a private repository you need authentication, usually a deploy key.

PULLING UPDATES

Change to the repository directory and pull. New code is in place immediately.

WHAT NOT TO COMMIT

Configuration files containing credentials The uploads or media directory, which is data rather than code Dependency directories such as vendor or node_modules, which should be installed rather than committed Cache and compiled files

Use a gitignore file to exclude them.

WHY THIS BEATS FTP DEPLOYMENT

Version history, easy rollback, and no partially uploaded files.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot