tags:

views:

819

answers:

10

I have heard that uploading your website with FTP is now for n00bs, but it's the only way I've known how for the 8 or so years I've been building websites. Apparently all the buzz now is using a version control system, like SVN or Git, and somehow using SSH to upload only the files that have changed (if I understand correctly). I'm wondering if someone could explain or point me to a "comprehensive" guide. What do I need to install, and will my shared host (Dreamhost) be compatible? I currently develop on a WAMP environment. I have never used version control and wouldn't know where to start. I usually develop with a framework such as CakePHP or Zend.

+1  A: 

Here's an wiki that should give you all the information you need on adding Subversion to Dreamhost.

http://wiki.dreamhost.com/index.php/Subversion

I've used Subversion now for my sites, and it does make it much easier. I use Aptana on my Windows machine and upload everything through that program. It allows me to compare old versions, revert to them, branch off new versions, etc...

It's a huge timesaver!

Matt
+2  A: 

First you'll want to decide what you want to use for version control. I hear great things about Git, but am still an SVN user myself.

Dreamhost actually lets you create SVN repositories with their webpanel, very keen there and I can't remember but I thought they had some additional really nice features to help.

I would suggest reading or skimming through at best: http://www.svnbook.org it is very comprehensive if you plan to actually use SVN over Git.

thismat
A: 

There is no problem using ftp to upload. The only disadvantage is that the password is transferred as plain text.

It would be good to have a local version control system, that would allow you to easily see changes between versions, and quickly revert to an older version, and much more...

I don't think there is a need to install a version control system on your shared host. Only if you want to access the version control system from different sites (at home, at work, while traveling), it can be handy.

Wimmel
+5  A: 

For the file uploads, what you are looking for is rsync. There is a Windows wrapper for this called DeltaCopy and the DreamHost wiki has instructions.

Colonel Sponsz
A wonderful tip - thank you !
Tal Galili
+1  A: 

Eric Sink's articles about source control are a great place to learn about the basic concepts.

http://www.ericsink.com/scm/source_control.html

Derek Kurth
+12  A: 

You've got things mixed up a bit. A version control system is used internally to keep track of your code during development. With centralized systems like SVN, you regularly upload your code to a SVN server, which keeps track of what has changed, makes sure conflicting changes are merged correctly, and keeps a history so you can roll back changes.

Decentralized or distributed version control systems eliminate the one central server, instead allowing every single copy of the code to track its own change history, and then letting you merge and combine these separate branches at will.

But once you have a complete product, you push it out to the production server any way you like. FTP is certainly one option for doing that.

jalf
Exactly. I think the OP is thinking of using SVN to deploy, which can be done but does require some forethought. In all reality, an svn export shell script is what would be needed, to grab the latest revision and export a clean copy to the web server.
Abyss Knight
post commit hook could be used as well
thismat
A: 

Everyone is completely missing the point. Development using a version control system is a great thing and has massive upside even for developers working on their own. The question here is about deployment using version control systems.

This is a newer and great idea, consider something like Magento which has 6,744 files in the base install, not mentioning when you start adding your own skins which usally run to around 500 files. Using version control to DEPLOY something like this saves major time uploading this many tiny files via FTP as only the modified ones are sent.

Asside from this, I've never actually tried deploying like this so I can't offer any real world experience, however there are several good articles on how to get this setup, a good one can be seen here.

+1  A: 

I also develop with Zend Framework and here is how I use FTP and Version control.

On my local machine I have Subversion and TortoiseSVN installed.

  1. If I start a new project, I set up an SVN repository the way I like it (I use the trunk/branches/tags system).

  2. I checkout an initial working copy from the trunk to a project folder in my local webroot.

  3. I create a new project in Aptana and set the project path to my project folder on the localhost.

  4. Aptana understands that this project is versioned and shows appropriate icons on each file. I can do many of the version control functions directly in my file tree in Aptana, no need for any shell or even Tortoise.

  5. Once I have a stable, deployable version of my app, I create a version control tag. Then I do an export of that (unversioning it).

  6. The exported app is then uploaded via FTP.

That's how I do it at the moment anyways, maybe it clarifies somethings. Tips on improving the procedure are welcome!

tharkun
A: 

There is an awesome plugin for bzr called bzr-upload, designed exactly for your kind of use-case. bzr is very light-weight (no need to set up any repository) and super easy to start using, even if you haven't used any kind of source control before. It's a plugin for bzr and every time you make a commit on your local machine, it will s/ftp the changed files up to your web host. It doesn't push up all the version control info, just the files themselves.

pfctdayelise
A: 

As others have said, you can set up version control locally ... or on your host. I recommend you do whatever works best for you.

You mention using Dreamhost. I support one small site there, and know that they do allow uploading via scp and sftp. This would allow you to upload your files with your password encrypted. (And you don't have to adopt a version control method if you don't want to! ;-) Scroll down the sftp page I linked to and you'll find some suggestions for scp & sftp clients.

FWIW, if you're using Windows, I've used WinSCP for years and liked it. Also, if you want full login access, I suggest PuTTY; its full download also includes command line based clients for sftp and scp.

PTBNL