Git vs FTP for web deployment
Solution 1
Using your favourite version control is the only sensible way to deploy anything.
Git is not only about collaboration and distributed VCS it is also a serverless VCS (by definition) - so you can deploy from your dev machine to your deployment target.
To summarise when setup properly to deploy your changes is as simple as;
git push hub master
For more information A web-focused Git workflow and Using Git for Deployment
I'm not going to answer the subjective bit of the question; there are a myriad of reasons why I'd deprecate FTP - but it is a valid way of transferring files as long as you understand the limitations of the technology.
I will however say that you absolutely must be using version control within your deployment strategy.
Solution 2
See the following links for instructions on how to deploy a Git repo to your server:
- Deploy your site with git
- How to deploy your code from GitHub automatically
- A web-focused Git workflow
fs_tigre
Updated on June 07, 2022Comments
-
fs_tigre almost 2 years
I know what git is for and how to use it, (a little bit) but there is one concept I still don’t fully understand. I have heard a lot of web developers lately saying that they use git for every web project even though they are not collaborating, they just use git as an FTP alternative, in fact they claim that FTP is an old method to upload your sites.
My question is, how could I use git to upload my site without having to pay for a service such as beanstalk?
Is really FTP considered an old technology and we should be using git?
Thanks a lot
-
Felix Kling about 11 yearsYou cannot compare Git wit FTP. Apples and oranges. Since Git has capabilities to synchronize repositories across different machines (i.e. it can transfer files), you could use it as FTP alternative. However, the main purpose of using Git is of course having a SCM. So: No, you should not use Git instead of FTP, but for your project, you should use Git (or any other SCM).
-
ghoti about 11 years+1 on everything Felix said. Also, if you're using a VCS (perhaps a better term than SCM in this case), explore
git archive
which will help you package a release for publishing to your web server. -
brentonstrine about 9 years"My question is, how could I use git to upload my site without having to pay for a service such as beanstalk?" How does this solicit debate, etc?
-
-
fs_tigre about 11 yearsThanks a lot for the good info.
-
fs_tigre about 11 yearsThanks a lot for your reply!
-
mo. over 10 years"Using your favourite version control is the only sensible way to deploy anything." ... How does that apply for compiled websites like ASP.NET or JSP? Or do you just mean using version control to commit to master/default and push so your build server picks it up, builds it and deploys it?
-
Richard Harrison over 10 yearsASP.NET I've done various ways; the simplest is to include the deployment package or binaries into the repo and push this out; also built a custom one; but this is what I'd do today jayway.com/2012/10/17/… It's the concept of doing it from FVC rather than the method (of which there are many) that I was trying to get across.