Newb question: placing .hg on network

Martin Geisler martin at geisler.net
Mon Dec 9 17:44:06 UTC 2013


David Spitzley <dspitzle at wash.k12.mi.us> writes:

> I've looked around online and tried searching the list archives, but
> I'm having trouble parsing an answer to my question if there is one.
> I'm working with Laravel on Windows 7 with IIS (probably immaterial in
> this case), I'm trying to set up my first repository to track my
> application files (C:\inetpub\laravel\app), and would like the .hg
> folder to be stored on my network drive (H:\) so that it gets backed
> up. What do I need to do to either override or work around Mercurial's
> default behavior of placing .hg in the root of the folder I'm
> versioning so that the repository winds up in H:\.hg rather than
> C:\intepub\laravel\app\.hg?

You cannot move the .hg folder outside of where your working files
reside. That is by definition: the "working copy" *is* the parent
directory of the .hg folder. So if you want to version files in

  C:\inetpub\laravel\app

you must have

  C:\inetpub\laravel\app\.hg

To get the content onto your H drive for backup purposes, I would
suggest that you use the "distributed" part of DVCS. That is, create
your repository on your C: drive like described above and then make a
*clone* of this somewhere on the H: drive.

You then push from the repository on the C: drive to the repository on
to the H: drive regularly, say daily.

An alternative is to use the share extension shipped with Mercurial.
That basically links two repositories together to that a commit in one
is immediatedly visible in the other -- if the other is on your backup
drive, then that should work pretty good.

-- 
Martin Geisler

http://google.com/+MartinGeisler | http://careers.stackoverflow.com/mg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20131209/819e2ef9/attachment.asc>


More information about the Mercurial mailing list