Web Development

git push vs. FTP

November 25, 2016

Building a website is great, but a website doesn’t do any good if no one can see it! Without deployments, you may be able to see your website, but no one else will.

In order to be useful, every code change must be deployed, usually to multiple servers, as part of the development and release process.

One common way to deploy code changes is via FTP. Using FTP (or SFTP) for deployment has additional time, cost, and risk that we would rather avoid, especially when there’s a much better option readily available: deploying via git push.

Sometimes we’re asked why we go through additional work to set up deployments with git. Here are 8 reasons why:

  1. With FTP deployments, you need to re-upload the entire website with each change (or manually track which files have changed) whereas git will automatically transfer the exact changes needed.
  2. Git allows us to work with complete changesets rather than individual files. Oftentimes a change in one file will depend on a change in another file. With git, these changes are all bundled together in a commit, whereas with FTP we’re forced to always work with individual files and directories.
  3. With FTP deployments, you can’t tell which version of the code is currently running on the server, whereas git keeps track of that and makes it easily accessible.
  4. With git running on the server it’s very easy to see files which may have been modified or added by malicious code or hackers; with FTP there is no such visibility.
  5. Git uses ssh as the network protocol which allows for individual password-less keys to be used for authentication, instead of shared passwords.
  6. FTP deployments are much more difficult to automate or integrate into a larger deployment workflow which should include things like CSS compilation, JavaScript minification, deleting private files, and more.
  7. Git provides a number of hooks which can run during and after updates are applied, allowing you to run custom scripts automatically when deployments are made.
  8. Git also makes it very easy to roll back to a previous version of the code – should that ever be necessary – since all past versions are already stored on the server.

For these reasons and more, we prefer using git for our deployments.

How do you deploy your code? Leave a comment or a question!

You might also like...

25

Apr.

How to Create a Fuzzy Search-as-You-Type Feature with Elasticsearch and Django

Tutorial: How to Create a Fuzzy Search-as-you-type Feature with Elasticsearch and Django Recently, I had to figure out how to implement a fuzzy search-as-you-type feature for one of our Django web APIs. I couldn’t find any comprehensive tutorial on how to build this specific feature, so I decided to combine multiple sources and document the … Continued

12

Apr.

6 Things to Look For in a Web Hosting Provider

People often ask us who we recommend for web hosting. Different needs dictate different solutions but there are some universal requirements which almost always need to be met. We have client sites running on many different hosting providers but rather than discuss specific companies let’s go over what we recommend looking for in a web … Continued

26

Mar.

Why HTTPS Matters

What’s HTTPS? Hypertext Transfer Protocol (HTTP) is the underlying data communication system for the Internet. A simple example of the protocol is when you landed on this page, your browser (e.g. Chrome, Safari, etc.) made an HTTP request to the computer that’s hosting this website, and then the hosting computer sent back an HTTP response … Continued

Pacific Science Center

application maintenance and development

Pacific Science Center

Cisco

mobile development

Cisco

Deloitte

web design, microsite development

Deloitte

Seattle Public Library

ui/ux design, microsite development

Seattle Public Library