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 am currently working on several different projects. I use Mercurial for version control (through BitBucket) and SpiderOak for automated backup. I work on two machines, a desktop at home and a laptop when I'm out and about. I have set SpiderOak to automatically synchronize my /home directories (which contains the various repositories for my projects) between the two machines.

Currently SpiderOak also synchronizes the .hg subfolder for each repository. But I think this is causing problems. I just committed and pushed a repository to BitBucket from my desktop. I then started working on the project on my laptop after SpiderOak had synchronized the files, but without pulling and updating from BitBucket. Then when I tried to commit and push from my laptop, I got the following error message:

abort: push creates new remote head 7f6bf2d3292b!
(you should pull and merge or use push -f to force)

On the other hand, I used to have SpiderOak just synchronize the project folders without synchronizing the .hg folders. That caused problems when using Mercurial too. For instance, if I'd work on a project on my desktop and create a new file, say newfile.tex, then that would be synchronized to the laptop via SpiderOak, and (on the desktop) I would add it to the Mercurial repository via hg add newfile.tex. But since the .hg folder wasn't synced between the two machines, the repository on the laptop wouldn't know about newfile.tex, even though I had added it to the repository on the desktop. I don't want to have to add the files to the repositories on both machines individually.

I see that this is somewhat rambly, So the question boils down to the following:

  1. Should I synchronize the .hg folders or not?
  2. What workflow should I use to ensure that everything is properly synchronized and that Mercurial doesn't get mad at me?
share|improve this question
up vote 0 down vote accepted

Why sync your source code at all (using SpiderOak)? I would just use your version-control (Mercurial) tools to do the syncing. If you use your version-control tools, it will know about all file changes and it will behave correctly.

share|improve this answer
I guess that makes sense. Then I could just use SpiderOak to back my projects up without syncing the two machines, and anytime I was switching machines I would let the version control take care of syncing. – MTS Mar 19 '13 at 22:18
I'd vote your answer up but I can't even do that yet! – MTS Mar 19 '13 at 23:17

You must log in to answer this question.

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