Mercurial - Add project which is not within repository folder

后端 未结 3 1094
旧巷少年郎
旧巷少年郎 2021-01-20 05:25

I am an inexperienced Mercurial user. I am using VS2010 with Mercurial. I had everything working nicely against a single repository, which contained a solution file and tw

相关标签:
3条回答
  • 2021-01-20 05:33

    I found the best way to manage multiple folders in one repo by just creating a symlink (mklink in windows). I usually work in Visual Studio, so I typically have a code library and a website directory, but they are not in the same parent folder.

    You can create a symlink on windows like so:

    mklink /J "Target Path" "Source Path"
    

    So I would have a structure like so:

    project root
    - Code Library
    - Solution File
    - Web Folder (symlink from locally-hosted website folder)
    
    0 讨论(0)
  • 2021-01-20 05:41

    No, you cannot add anything that is not under the repository root. hg add will abort with X not under root message. Move your files into the repository, or move the repository so that all of your files are under the root (note that this will generate a lot of file moves, and you really shouldn't do that).

    0 讨论(0)
  • 2021-01-20 05:43

    You should use a different repository for each project. This is because when you do a commit in hg, the commit is for the entire hierarchy, not just the directory (and below) that you are in. For more details have a look at the One last big conceptual difference section of http://hginit.com/00.html

    0 讨论(0)
提交回复
热议问题