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:
- Should I synchronize the
.hgfolders or not?
- What workflow should I use to ensure that everything is properly synchronized and that Mercurial doesn't get mad at me?