views:

41

answers:

1

I've installed a repository on my computer locally. What I'm trying to do is be able to work on a website locally on my computer and see changes using something like MAMP. When I commit a change though I'd like it to sync my repo with the live website source files on a remote FTP server.

I've done a bit of digging and I know that people keep saying to use a post-commit hook but I'm not sure how to configure it or even how to install it locally. Also i'm not sure if it's possible to do from my computer to an FTP.

Could someone be a huge help and walk me through how to do this I've been trying for hours to figure out how to do it.

thanks so much.

A: 

There are examples in the hooks directory of the subversion server. Depending on your platform ('nix or windows), you'll probably use either the .sh or .bat (may be currently named with .tmpl extension, for "template", I believe). Anyway, you just rename to something that will execute, and you've got a hook. Now you have to modify it to call something that will do you rsync. Ideally, asynchronously (fork a process, or on windows, maybe use the START command) in a separate process, so it doesn't hold up your commit.

Now for the sync... I think what you really want to do is to trigger a checkout on the remote server. Again, this is platform dependent. But the idea is the same. rsh/ssh on 'nix maybe?

Another idea would be to trigger a LOCAL (on the repo machine) checkout, then use something like unison, rsync, dropbox, secondcopy, etc., to sync that with the remote machine.

Or have the remote machine just do a checkout every 10 min.

Chris Thornton