Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

When developing web applications, how does one keep local files and remote files synced together? There is the obvious way, whenever you edit a file on your local machine, just upload that file to the remote machine. Is there a more efficient way? I ask because I have been using subversion control, and it is so easy to keep files synced on a remote server. All I have to do is "commit" and it will find the files which need to be replaced.

share|improve this question
1  
Are you on Mac OS X, Linux, or Windows? That changes the answer to your question. –  Archio Mar 20 '11 at 6:14

3 Answers 3

Here are some options:

Software

Web development suites for Mac OS X like Espresso and Coda have automatic FTP upload functions, where you can click a button and all the changed files in your local server upload replace the old ones in the remote server.

For Windows: Although there is no direct equivalent of these programs, Aptana is an IDE that has FTP-upload functions, or Notepad++ could work with it's ftp_synchronize plugin.

Symlinks

You could also set up a symlink between your local webserver root and a mounted FTP folder in your file structure like this:

ln -s ~/path/to/local/server ~/path/to/FTP/client/

Then, every time you change anything in the local folder, it is automatically placed/replaced into the FTP folder you have mounted. (On Windows, use mklink /d instead of ln -s).

Scripts

Additionally, if you wanted to, you could write a script (Applescript on a Mac, or VBscript on Windows) that uploads the files, however, this could get complicated and would require advanced knowledge of the scripting language of your OS.

share|improve this answer
    
Under the software category, is there anything for Windows that does that? –  Kelp Mar 20 '11 at 7:57
    
Unfortunately, Windows is rather lacking in this area, as most good web development apps are made for Mac OS X. However, check out this question (stackoverflow.com/questions/869886/pc-equivalent-of-coda), and see if there's something there you would like. –  Archio Mar 20 '11 at 15:35

On a PC, provided the destination (web server file system) is accessible as a UNC path or drive letter you can use any one of a number of backup programs to do this.

share|improve this answer

I'm using rsync for that purposes. Works on Windows, Mac, and Unix/Linux. A little bit hard with file permissions on Windows, but after few hours of digging I managed to do it right. Very fast when synchronizing file trees.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.