views:

150

answers:

9

What do you use to synchronize development on different computers/laptops? Eg at work I might use a PC, then I jump on the train and use my laptop, at home I use another laptop. On each of them I might use linux or windows.

edit: source control is a must but for synchronizing a bit limited in that you need a connection to a repository. Eg if a jump on the train and open my laptop I don't have an internet connection.

+5  A: 

Version control systems, especially distributed version control, work quite well for this.

Not only do they provide an easy way to make sure all of your development machines are on the same page, but doing so will also get you in the habit of committing to version control often, which makes it much easier to step back when you realize you screwed something up and figure out exactly what went wrong, when.

As referenced in a comment on the question, having a svn working copy or a git/hg repo clone on a USB key might prove handy if rapidly moving between machines without network connections.

Amber
+1  A: 

Source control. I use SVN. You can even use a free SVN repo at sites like xp-dev.com (allows private) and assembla.com

There are similar things for other source control types (git, for example).

-- edit

For a client, I use TortiseSVN, which is great, and integrates happily into the shell.

Noon Silk
A: 

If it is possible set up a version control system such as CVS or SubVersion.

Then you can have one central repository to checkout and commit your work from. I don't know if your job will let you do this though. Make sure that you configure it so that you aren't sending proprietary source code over an unencrypted connection if you are checking it out over the Internet!

Sean A.O. Harney
A: 

Use a web-based source control system, say subversion. Have a client on each machine, and commit whenever you have reached a large enough chunk of work. The first thing you do on each machine/OS, should be svn update.

Yuval F
+3  A: 

Try a DVCS like GIT or Mercurial.

You do not need an internet connection to commit and it syncing repositories works over many different protocols

nolim1t
+1  A: 

You should try Unison it is working across platforms. I am using it to sync everything which is not under a VCS as I am both using a laptop and a desktop for my development.

Unison is a file-synchronization tool for Unix and Windows. It allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.

Loïc d'Anterroches
+1 I have extensively used Unison and can confirm that it works very well. It even handles conflicts, meaning you can safely update both copies beween syncs.
sleske
+1  A: 

Given the limitations you enumerate... why not put your sourcefiles on a small flash card(*) or USB stick? Edit the files on the card, sync with your source control system whenever you can (i.e. probably when at work?)

(*) I'd go for a card because that fits inside my laptop rather than sticking out, but that is a personal preference

jilles de wit
+2  A: 

A development environment consists of these items:

  • your project files
  • your ide (s) specific files
  • development servers and data
  • documentation and issues

Your setup seems to be:

  1. various machines
  2. various os-es
  3. online and offline

The best way to reconcile all these demands is to be prepared in advance, and have your project dependencies independent. These solutions address 1) 2) 3).

Project files

  • As sugested, you should use a distributed SCM: git, mercurial, bazaar which work best in online/offline scenarios.
  • If not possible, Subversion is still an ok solution, if used with changelists introduced in Subversion 1.5. Some IDE plugins may already offer something similar, or may integrate well with Subversion changelists.
  • Very important: SCM services must be available anywhere in the world, not confined in the corporate LAN (my case :( ).
  • For easy transit, you could use a flash stick to do a checkout on of your projects, before leaving one development environment (esspecially when you go offline).

IDE Files

  • You should use a build script to handle all build tasks, and integrate it with your preferred IDE; thus bypassing the need of an IDE for some tasks.
  • You could rely on your build script to generate project files. For example, if you're on java, maven can generate project files for Eclipse, Netbeans, IDEA.
  • You could carry arround project files on your flash drive, just be sure all dependencies are relative to project; better yet, have your build tool handle all dependencies

Development servers and data

  • Usually this is hardest to replicate easily.
  • You should have build tasks that integrate and manage server dependencies. For example, if you use an ORM tool, you could use an embedded database for development purposes. Same goes for an application server.
  • If embedding is not possible, have your serves be slaves to your project; this means having one server dedicated to only one project. Each server:
    • shouldn't need to be installed or configured.
    • should be easily started/stopped with scripts - called from the build script.
    • should behave nicely if moved to another directory - and you could carry them around on your flash drive.
  • Test data should be generated by your build script. If you unit test, you already have plenty of test data, which should be easy to integrate with an embedded server.

Documentation and issues

  • Usually important info is buried on emails, or on someone's share.
  • Issue tracking and all documentation (let's say a wiki) should be available anywhere in the world. If everyone is careful and documents issues, and captures bits of info (like environments ports and ip's; contact data) on a centralized documentation service (wiki), then while online you will have access to all of these.
  • Offline, you should be prepared with what you need in advance. I believe that offline is the exception, rather than the norm.
  • I think there are plugins for IDE's that keep issues and other info available offline, like Mylyn for Eclipse.
Mercer Traieste
A: 

mesh.com works well on Windows. Try the dropbox.com if you are using Linux/Mac. You could get the best in combination with Git/Mercurial :)

Artem K.