2

This is my first time using Mercurial so this may be a very newbie question...

If I create a repository, e.g. c:\HG1 do all my files need to be under that directory?

Or can i add files from a different folder e.g. 'C:\myotherfolder'?

If you can add from diff folder...how, can't seem to figure it out.

thanks.

p.s. I'm coming from a non-distributed source control system so perhaps I'm just thinking about my workflows with that mindset.

Gern Blanston
  • 42,482
  • 19
  • 50
  • 64

2 Answers2

2

Yes, all of the files to be tracked must be under the root repository folder.

Mason
  • 703
  • 6
  • 20
0

No they don't, you can use a symlink (mklink on windows) in order to link another folder into your repository that is not in the same parent folder.

See my answer to a similar question here: https://stackoverflow.com/a/19473449/471924

Community
  • 1
  • 1
Corgalore
  • 2,486
  • 2
  • 23
  • 32
  • Based on your other answer, I assume you're referring to junction points, rather than symlinks, as Windows support for symlinks is pretty abysmal compared to \*nix (and last I heard, Mercurial didn't actually support symlinks on Windows). Be careful using junction points - Mercurial will see them as ordinary directories, so if you do anything that results in Mercurial having to re-create the directory - e.g. cloning the repository, or even updating under some circumstances within the same one - you'll lose the junction link and be left with another *copy* of the data. – anton.burger Oct 24 '13 at 08:07