Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two computers (work and home) and wish to set up a version control system for source code and TeX documents. There are no collaborators (i.e., single-user/editor). Most of the source files are written using the vi editor. I would like to have source/document versioning that is available on both computers.

Is there a particular versioning structure (centralized vs. distributed) that is better for single-user, multi-computer needs? For instance, I could set up one computer as a server and the other as a client, or alternatively treat both as peers.

Also, I want to be able to easily sync the two computers, and I don't know if rsync would be better for this, or if this function is better performed by the revision control system?

share|improve this question
odd question but why wouldn't dropbox work here? – Journeyman Geek Jan 7 '12 at 23:53
I think DVCS is very valuable here, if by "sync the two computers" means keeping different versions of TeX documents sychronised then a DVCS is 100x bettter than any file based solution. With one caveat: the learning curve is huge, you must learn not just lots of technical concepts, but also good habits. – Adrian Ratnapala Jan 8 '12 at 5:22
@JourneymanGeek: Dropbox isn't too good at version control... If you're dealing with any kind of textual and changing data, you absolutely want version control. – Joanis Jan 8 '12 at 7:24
I use Mercurial (Hg) for managing my personal files. Simple to use with a front-end such as TortoioseHg. Right-click, commit, done. – iglvzx Jan 8 '12 at 7:34

Disclaimer: my suggestion assumes you have internet connectivity at both home and work.

I have almost the same situation. I manage my source code and documents using git on a free UbuntuOne account. Whenever I need to change/add something I just clone the required repository (for example "project X docs") and do the work locally on either work or home computers or both and then push the changes. In a few occasions I even shared a source repo or two with colleagues to view/edit the files. git hasn't let me down so far with its excellent merge facilities.


share|improve this answer
Thanks for your suggestion, Bahman. I will look into git. Does using the cloud service add anything besides extra security? – user001 Jan 8 '12 at 1:26
There's also other good source code hosting services that can work. One of my favorites is bitbucket, which I believe offers free private mercurial AND git hosting for when a repository has less than 5 users. – John Chadwick Jan 8 '12 at 4:56
As John points out, UbuntuOne is not the main point but Git is (or Mercurial if you prefer). If one or both of your machines has a permanent address and can act as a "server", then you don't need to put anything in the cloud. If you do BitBucket and GitHub will be techinically nicer than UbuntuOne - but I don't know if it is fair to use free accounts there for private stuff. – Adrian Ratnapala Jan 8 '12 at 5:17
@user001 To be honest, I just put my files in the cloud because then I can reach them from anywhere. Also if you have the time, as Adrian put it, you can have your own server. – Bahman M. Jan 8 '12 at 6:07
@user001: Extra security is a relative matter when it comes to the cloud. If you have any sensitive data, unless it is state-of-the-art encrypted, forget the cloud. – Joanis Jan 8 '12 at 7:32

The sync system and the revision control system are two different things addressing different needs.

As a programmer you want to have version control over your code. If you do not need to sync anything else, don't bother with syncing, as it will obviously not provide version control (which itself can be used to sync). In that case, you can simply go for version control. And if you need to sync other things too, you will want version control anyway. So I would strongly suggest that you set up some code versioning first, and then think about the sync. Code without version control is... quite wrong.

Now, if you use centralized version control, you'll have to choose a server. Then, you'll have to backup that server, because you'll only have the current version of the code on your other computer. That's why I would suggest that you look for a distributed version control. Git or Hg (Mercurial) will do. That way, you have the full code version history on both computers. If one dies, you lose nothing (of the code at least!).

BUT, if you want to sync ANYWAY, using a centralized version control system is not that bad since you can simply sync its files to your other computer. That way you have centralized + automatic backup. Still distributed will have more flexibility when you change your mind.

It's your call. My suggestion is a distributed system (Git or Hg... they're quite similar, and they have hashing systems which make their code bases harder to get corrupted), and then see what you do with the syncing if you really need it.

share|improve this answer

I think the question in this post is unique.

No really, one user-one locations | many user-many location or any intermediate situation doesn't make А Big Change in usable SCMs

  • If both workplaces are Internet'ed and always reacheable you can select any *VCS (even CVCS) and update from repo anytime (for DVCS - pull from last-used repo to older) without 3-rd mediator
  • If hosts aren't always online, use (again) any SCM and store work on any SCM-hosting, which support selected by you SCM
  • If host are offline, you can recall "Omnia mea mecum porto" and have, f.e, Fossil SCM (portable, single exe, cross-platform) and repository on flash-drive
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .