Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Mercurial: Repository with No Working Copy

📅 2010-Mar-26 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Mercurial engenders an easy distributed working style. But, for important projects you might like to have a central repository that everyone pushes to and is backed up regularly. Since this central repository is backed up, it is irritating to have a working copy of files in it (which is the default behavior of Mercurial).

To have a central repository with no working copy, clone your existing central repository using the --noupdate (or -U) option:

$ hg clone -U FoobarCentralRep FoobarNewRep

Let everyone working on projects clone from this new repository and push their changes back to it:

$ hg clone FoobarNewRep MyFoobarExperiments