Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Version control to coordinate with yourself

For programming in my spare time, I have both a desktop and a laptop (both Macs, though I doubt that makes a difference the question). I've got VMware on both of them, with Linux images to run my code on. They're identical images, so I've got the same environment in both places.

The trick is that I like to use version control for ALL my coding, even when I'm not coordinating with someone else. I want to see the most recent version of my code on whichever system I'm using.

I don't want to depend on having network access at all times - I might be coding somewhere without wi-fi (yes, it's rare, but some places are still in the stone ages). I'm looking at using git, but something like SVN would also do if I had the repository available locally. Or maybe the laptop becomes the SVN server and the desktop accesses it.

Has anyone done this kind of thing before? Any traps/pitfalls/lessons learned?

like image 767
edebill Avatar asked Feb 02 '09 16:02

edebill


1 Answers

Well, I'd definitely recommend looking at a distributed system instead of Subversion. That will satisfy your requirement of not being dependent on network access, and probably just fits your workflow better. The major choices for a distributed VCS are git, Mercurial (also referred to as "hg"), and Bazaar (or "bzr"). My personal preference is Mercurial, but they're all fairly comparable.

However, one thing that Mercurial does have over the others (and it's something that would be very helpful in your situation) is the "hg serve" command. You can read about it here: Informal sharing with "hg serve". Basically it sets up a very simple (temporary) server to allow pulling your repository over the network. I use this all the time to keep code synchronized between my desktop and laptop. If I've made some changes on the laptop, I just run "hg serve" on there and then "hg pull" from the desktop, or vice versa if I've been working on the desktop.

So overall, I'd definitely suggest looking into the distributed systems, I think they'll do the best job of setting up the sort of environment you want. There's a fair amount of information available on the web about using all of them. I haven't spent much time with the others, but if you want to try Mercurial, this free online book covers pretty much everything you'll need to get started.

like image 117
Chad Birch Avatar answered Nov 11 '22 22:11

Chad Birch