Chat with us, powered by LiveChat

This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

Say hello to redesigned Cloudways, an empowering Startup Program, enhanced Staging, a new Let’s Encrypt Wildcard SSL certificate feature, and more. GET STARTED

Why Integrating Git Benefits Developers And Web Agencies

Updated on June 26, 2014

4 Min Read
Reading Time: 4 minutes

Cloudways has been enjoying the support of diversified set of customers including developers, and web agencies. Since the launch of Cloudways Cloud Platform, we have been very successful and stable with our quick release cycle. This helps in keeping our PaaS lucrative, yet flexible for each of our customer segments.


The new release we had a few days back targeted developers and web agencies. Our platform has finally caught the Git wave. Git is one of the most popular and widely used flavor of the Version Control and Source Code Management (SCM). It’s free and open source.

Version control, in a nutshell, tracks changes made in files over the period of time with the ability to revert to specific version that contains the snapshot of the files at a given point.

Why Git?

Unlike SVN where every developer commits the changes to central server, Git works on distributed version control with no compulsory need for central server. Every developer has his or her own repository with complete history of changes and does not need to connect to central repository every time. Instead, he or she can commit to his or her own “local” repository and later on push it to central server when required.

There are many other obvious advantages of Git that makes it very popular among developers. So if you are using Cloudways (or planning to do so), and you already have a code repository that you want to deploy on live website, then it’s quite easy on our Cloud Platform.

Cloudways supports Git over SSH to identify and authorize your server’s connectivity with your remote repo. Github, Assembla, Bitbucket, etc. are also supported.

How to use Git on Cloudways?

You will have to download the generated SSH public key first.

You should then add the Public Key to your vendor, for e.g. Github. Once this is done, you will be asked for remote repo URL or Git remote address, insert it and press clone. Thats it, your code (for e.g on GitHub) is deployed on the web application. By default, master branch is checked out. You can change and rename the branch. From there on, any desired updates on remote repo can be easily pulled from Cloudways Cloud Console.

A step-by-step Knowledgebase entry for this can be found here.

There may be few questions.

1) My development environment is different and I want to make sure config files do not overwrite for (e.g, production) Cloudways environment as both share the same Remote Git repo.

There may be few files that you may want to ignore for the applications hosted with Cloudways. Depending on the role of the application (e.g Production, Staging, Development), you can use .gitignore on your developer machine to do so.

2) What will happen to my assets (for e.g., images, etc.) in case of WordPress installation?

Deployment will not delete the existing files in public_html that are not present in the repo.

For example you have these files in public_html a.php, b.php, image.jpg, and git pull brings changes in a.php and b.php. Then a.php and b.php will be modified and image.jpeg will remain unchanged in public_html

Consider another example when git pull shows that a.php is deleted from repo, b.php is changed, and c.php is added, then these changes will be applied to your public_html i.e. public_html will have c.php added, b.php modified, and image.jpeg unchanged. a.php will be deleted from pubic_html.

3) Can I deploy to specific folder within public_html?

Yes, you can specify the folder within public_html when deploying. For example, as an application developer you may have a repo with just a theme and you can deploy that repo to theme folder under public_html and not to public_html root.

4) Can I still use SFTP?

Changes you make via SFTP will overwrite the last changes you pulled via Git. Your next pull from Git (if involved changes in the file are modified via SFTP) will then again overwrite the changes you made via SFTP.

5) How offsite backup restore will work in this case?

Any restore activity will overwrite the whole website and will revert your site to the point where your last backup was taken. It is important to note here that assets (i.e., images, etc.) will be reverted. The Git pull, from there on, will again take precedence and will only overwrite the changed files.

6) What will happen if I remove the Git settings from the console?

Deleting repository from Cloudways Cloud Console will only delete the repo traces from your Cloud server. It won’t delete anything from your public_html nor anything from the source repository.

7) Can I automate deployment to Cloudways?

We are working on git hooks to automate deployment to Cloudways. Meanwhile we have explained the integration using DeployHQ and for automating deployments.

Tell us what do you think?

We will be adding options to revert to specific revisions through Git. We are actively working to make the Cloudways Cloud Platform the most convenient PaaS ever. To achieve this, your feedback is essential. Feel free to tell us about the features you want in the comments section given below.

Share your opinion in the comment section. COMMENT NOW

Aaqib Gadit

As Co-founder and Director of Cloudways, Aaqib is responsible for the services portfolio, strategic planning, product and business development.

Start Creating Web Apps on Managed Cloud Servers Now

Easy Web App Deployment for Agencies, Developers and E-Commerce Industry.

Get Our Newsletter
Be the first to get the latest updates and tutorials.