Skipping version control files while FTPing

If you are developing on your desktop and FTPing files up to your server, you can quickly end up with a mess of .svn or .git folders or files hanging around making a mess of things (you are using version control, right?). Apart from being untidy, these files can wind up as a security risk if they end up on a live site. There are a number of methods you can try to keep them at bay - avoid selecting them for upload or mark them as hidden, but another convenient way is to tell your FTP client from sending them.

Looking at two popular clients - FileZilla and WinSCP - we can see how this can be done. Essentially we are filtering what is sent on name, so the technique can apply to any other files you wouldn't want to upload (such as Window's "desktop.ini" files). You'll just have to keep in mind that it is happening in the background - trying to debug where plugin.svn.php got to could be frustrating.