24

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).

9
  • 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, 2011 at 11:57
  • 31
    Source control is never over the top (IMHO) ! May 16, 2011 at 12:12
  • 5
    It takes <15 minutes (depending on download bandwidth) to install and get Git up and running. May 16, 2011 at 12:22
  • 2
    it takes < 3 minutes (depending on download bandwidth) to install and get dropbox up and running.
    – Darknight
    May 16, 2011 at 12:35
  • 7
    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.
    – user7519
    May 16, 2011 at 16:11

11 Answers 11

41

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.

6
  • 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.
    – user8709
    May 13, 2011 at 3:02
  • 22
    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. May 13, 2011 at 3:05
  • @Brandon - also works for a main repo on an external drive, when having it connected all the time is a pain.
    – user8709
    May 13, 2011 at 3:09
  • 2
    Remember, BitBucket has free private repositories (unlike GitHub), which probably makes it a better option for the OP.
    – Kevin Yap
    May 13, 2011 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. May 13, 2011 at 4:24
7

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.

6
  • Essentially what I do. Mercurial repositories on my desktop and laptop, main repository in Dropbox, which I push to and pull from. May 13, 2011 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. May 13, 2011 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. May 13, 2011 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. May 16, 2011 at 12:56
6

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.

2

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.

1
  • Unfuddle is a great service. Basically it's just a copy of redmine with some nice tweaks.
    – Benbob
    May 16, 2011 at 13:05
2

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.

2
  • 1
    Bitbucket is a service providing Mercurial hosting. May 16, 2011 at 12:38
  • thanks. i knew that; but names get tangled in my mind
    – Javier
    May 16, 2011 at 13:34
1

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.

1
  • Well, it may have been free for 3 users, but it's now $25 per user per month. Still, seems like a cool produect. Apr 11, 2012 at 21:24
1

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.

1
  • Nice! Thanks for mentioning this -- I hadn't yet heard of Google Code before. Apr 18, 2012 at 18:12
0

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.

0

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.

4
  • 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. May 13, 2011 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, 2011 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, 2011 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.
    – Benbob
    May 16, 2011 at 13:17
0

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.

-2

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.

5
  • 1
    You can use Git together with Dropbox. See stackoverflow.com/questions/1960799/… May 16, 2011 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, 2011 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, 2011 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.
    – Benbob
    May 16, 2011 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, 2011 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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