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.

I program on my desktop in my office, but also sometimes at home in a different room on my laptop, and even away from home. What I need is a system that automatically or on-demand syncs my work from one to the other, at need.

I do not have a home network setup, and although I guess I could do it, that would be a question for another board, perhaps. I've thought about some kind of system that would keep the source code in the cloud, but I don't know enough about this to get started. I need a kind of free or cheap way to do this.

I work in .NET (Windows Phone 7, in fact).

share|improve this question
1  
use dropbox, just install it on both machines and be done with it. Its free (up-to 2GB). For your situation source control is over the top (IMHO). –  Darknight May 16 '11 at 11:57
25  
Source control is never over the top (IMHO) ! –  Mongus Pong May 16 '11 at 12:12
4  
It takes <15 minutes (depending on download bandwidth) to install and get Git up and running. –  Mongus Pong May 16 '11 at 12:22
2  
it takes < 3 minutes (depending on download bandwidth) to install and get dropbox up and running. –  Darknight May 16 '11 at 12:35
4  
DropBox is a terrible suggestion! It isn't a proper version control system, it is for sharing data. It have a very nasty habit of uploading and downloading changes everytime you save a file and syncing to all the other clients in real time, it completely bogs down your machine doing all this un-neccesary network traffic especially if you are using something that builds artifacts in the same directory that is in DropBox. Learn and use Git or equivalent DVCS. –  Jarrod Roberson May 16 '11 at 16:11

11 Answers 11

up vote 38 down vote accepted

The easiest way is to use one of the online systems. Checkout GitHub or BitBucket. For more information on Git or Mercurial, check out Git Reference and Hg Init, respectively.

share|improve this answer
    
Maybe, if all machines have internet connections, but there are other use-cases. For example, I keep some subversion repositories on a USB flash stick, and some bigger ones (not source code - photos and things) on an external hard drive. When I get happier with the transition, I'm also likely to have Mercurial repositories on USB flash drives. One reason - I still use Windows XP for a lot of things, but I will not under any circumstances allow it (laptop or desktop) on the internet these days. –  Steve314 May 13 '11 at 3:02
20  
The nice thing about distributed version control systems like Git and Mercurial is that you can work with your repo locally, and then sync with some central server whenever you happen to have a 'Net connection handy. Sounds like the ideal solution for the OP. –  Brandon Tilley May 13 '11 at 3:05
    
@Brandon - also works for a main repo on an external drive, when having it connected all the time is a pain. –  Steve314 May 13 '11 at 3:09
2  
Remember, BitBucket has free private repositories (unlike GitHub), which probably makes it a better option for the OP. –  Kevin Y May 13 '11 at 3:14
    
The reason I didn't suggest running it locally was because he didn't sound like he would be comfortable with that, and he said he needed remote access to it. But obviously, running locally and pushing to a cloud repository is the best/safest way to go. –  Peter Rowell May 13 '11 at 4:24

You can use DVCS like Git or Mercurial that can create local repository, then install Dropbox and put your project folder (including the repository folder of course) into the dropbox folder.

Dropbox will handle the synchronization and it can handle offline situation as long as you are modifying only in one place between synchronization.

BTW Dropbox will not expose your files to public by default, but you can still expose them if you want.

EDIT

Concerning repository integrity in case Dropbox misses synchronizing a file or two, you can create a master repository outside Dropbox folder in your main PC, and push to it. So if the local repo inside Dropbox folder gets corrupted, just restore from the main PC. But I haven't experienced repository corruption.

share|improve this answer
    
    
Essentially what I do. Mercurial repositories on my desktop and laptop, main repository in Dropbox, which I push to and pull from. –  David Thornley May 13 '11 at 13:30
    
@David I do it in reverse, main repo in PC, work repo in Dropbox, including source code files that I'm working on. –  Endy Tjahjono May 13 '11 at 13:32
    
@Endy Tjahjono: It sounds from your comment like you do your work on one computer. I use my desktop sometimes and my laptop sometimes, so it doesn't really work to have my main repository on one of them. –  David Thornley May 13 '11 at 13:52
    
@David my mistake, I should have said 'backup' repo in my main PC. My 'main' repo is the work repo inside dropbox folder. I just push to the backup repo occassionally for backup purpose. –  Endy Tjahjono May 16 '11 at 12:56

Here are some quick instructions on how to set up a distributed VCS. The benefit of using git or mercurial is that you don't need to set up a server to get it all working as the repository is just a file system. You have the local repository in your computer next to your code (in git there is one .git folder and in mercurial there is one .hg folder in the project path).

Using git

Step 1: Download and install git. For windows you may want to use TortoiseGit. Some setup notes are here.

Step 2: Follow the git community book to initialize local repository for your project and commit to the repository.

Step 3: To put things on the "cloud" that is github you can follow this tutorial.

Using Mercurial

Step 1: Download and install mercurial. For windows you may want to use TortoiseHg.

Step 2: Follow the Quick Start guide to create repository for your project and commit to the repository.

Step 3 To put things on the "cloud" that is bitbucket you can follow this tutorial.

If you're working on .NET you might want to use Mercurial because of (sort of) better support in Windows at the writing moment.

share|improve this answer

As already @peter-rowell and others have rightfully said, The easiest way is to use any one of the DVCS like Git and the corresponding online systems like Github or Unfuddle. I personally use Git and Unfuddle.

Since, you've mentioned that getting Internet connection at home also isn't a problem for you, there is this new online IDE which runs in the browser and lives on the cloud. I didn't know anything was available like this before, but this looks very interesting and cool. Although, I haven't used it much, but its cool.

share|improve this answer
    
Unfuddle is a great service. Basically it's just a copy of redmine with some nice tweaks. –  Keyo May 16 '11 at 13:05

Almost any DVCS would help.

The most popular are Git, mercurial, and a few others; but I really like Fossil. It's a single (small!) executable, easily portable, self-contained, multi-platform, and includes a wiki, web-based GUI, ticket system, documentation handler, etc.

share|improve this answer
1  
Bitbucket is a service providing Mercurial hosting. –  Tamás Szelei May 16 '11 at 12:38
    
thanks. i knew that; but names get tangled in my mind –  Javier May 16 '11 at 13:34

The option I would suggest would be Kiln. It is made by the same exact people that make FogBugz and Stack Exchange. So it should be pretty good, also it is free for up to 3 users I believe. The scale is just like FogBugz and the two can be intergrated so you can keep track of bugs and features as well.

Just like Joel had said in one of his blog posts bug tracking and source control are always a plus, even to a lone developer.

share|improve this answer
    
Well, it may have been free for 3 users, but it's now $25 per user per month. Still, seems like a cool produect. –  Cyberherbalist Apr 11 '12 at 21:24

If privacy of your code is not as issue then Google Code might a viable solution. It takes care of the hosting part and it is free and fairly easy to setup. It supports Subversion, Mercurial and Git, which all have Windows clients. It also integrates with Google ID's so you can easily add contributors to the project. I host my hobby projects there using Mercurial. I have the TortoiseHg client installed on both my home and work computer, so I could work on my projects during breaks.

share|improve this answer
    
Nice! Thanks for mentioning this -- I hadn't yet heard of Google Code before. –  Cyberherbalist Apr 18 '12 at 18:12

It depends on what your knowledge about setting up a server is and what time you're willing to invest.

Personally I've rented a small virtual server from a hoster and installed an Apache Webserver an integrated a Subversion repository (which I'm now converting to git). The setup really isn't that much and once it's up and running, you no longer have to worry about it. This setup has the advantage that you're not only be able to setup a version control repository but also other kind of stuff that you want to access from whereever you are (I've installed a WIKI and an issue tracker for example).

If that's too much overhead for you you can always use the already suggested online systems like GitHub.

share|improve this answer

The easiest is probably to go with git provider, github has the possibility to pay for a private account.

But don't forget about svn, it is simple and easy to use. You could install a svn server somewhere that you can reach it, probably at work. (And project like Visual svn server makes this really easy on windows.) As a client you could use either a Visual Studio plugin or tortoisesvn.

The only thing you need to remember is that you need to commit and update when you switch computers.

share|improve this answer
    
I don't think SVN is the right answer here. I found it easier to set Mercurial up than SVN, and it's a better system than SVN. SVN is useless without a direct connection to the central repository, and the OP has two computers that apparently don't have a direct link. –  David Thornley May 13 '11 at 20:23
    
I'm not sure, svn is easier than the distributed alternatives. But since he can't reach the server at all times you have to be disciplined when you want to branch. But a one man show seldom do that anyway. And the need to commit is when you change computer, so I agree that it is not optimal. But it is a alternative. I actually worked like this before I started to use git. (But with git it is easier to get wrong). –  Johan May 14 '11 at 6:20
    
My assumption is that he is moving the laptop with him when he goes to work, otherwise this will not be a easy setup and David is correct. –  Johan May 14 '11 at 6:24
    
Time taken to setup a git or Hg repo (git init), a couple of seconds. With subversion you need a server first, which is a lot harder than just running git/hg init in your directory. I'm impatient and lazy and Git encourages me to use SCM because it (merging, initialising, committing) is so quick and painless. –  Keyo May 16 '11 at 13:17

I use Beanstalk. It has worked great for me as a personal SVN server. They also have Git hosting but I haven't tried it. They have a free account to start with, and then you can graduate to a paid account if necessary.

share|improve this answer

Dropbox

All the other solutions are over-blow for your needs:

Just install Dropbox on both computers.

A full blown source control is nice but in your situation its not needed IMHO.

This is the most easiest simplest path to take -> you just end up with auto-synced folders on as many machines as you want.

share|improve this answer
1  
You can use Git together with Dropbox. See stackoverflow.com/questions/1960799/… –  Mongus Pong May 16 '11 at 12:15
4  
There's nothing overblown about using source control, especially when Git and HG are so easy to set up. I don't think it matters that he's a sole developer, if he's writing production code he needs source control. –  richeym May 16 '11 at 12:26
    
Yea your probably correct. I just think for a single developer its just plain unnecessary and OTT, but heck that's my view. –  Darknight May 16 '11 at 12:46
    
git init,git add .,git commit -m "bla" is about all you need to know to commit some code. Not hard and you get the piece of mind that you can revert it. Of course the benefits are much more important in a team, but I like to be able to reset back to point in time is important. Being able to branch and stash makes me more productive too. –  Keyo May 16 '11 at 13:11
    
I hear what your saying, in drop box its real-time synchronisation, it does have basic roll back. Yes its nothing compared to a full blown source control, but then its pretty much "fire & forget" –  Darknight May 16 '11 at 14:53

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.