Friday, January 28, 2011

Mercurial clone ignore the ignored

So i have a local clone and a central repository. Now I need to create local clones from the main clone and use them. The problem is the clone command is ignoring ( like it should the ignored files ).

But there are many configuration files in this case and i need a way for the local clone to copy everything , even the ignored files

  • You can infact just make a copy of the clone using your normal filesystem commands. In Linux this could look like:

    $ cp -a repo repo-clone
    

    That will create a perfectly file "clone" of your Mercurial repository. The differences between cp and hg clone are:

    • hg clone will reuse space on your harddisk by using "hard links" between the files in the .hg directory. This also makes hg clone faster for large repositories.

    • hg clone will also write a .hg/hgrc file with a default path pointing back to the source

    • hg clone will take care of locking the source and destination repositories as needed. This means that you must take care that noone is writing (pushing or committing) to the source while you copy it with cp.

0 comments:

Post a Comment