简体   繁体   English

如何从项目中删除Mercurial .HG文件夹,但仍将其置于源代码控制下?

[英]How do I remove Mercurial .HG folder from project but still keep it under source control?

I am using Visual Studio 2010 and I noticed when I published my project that all the files in the published directory were also under source control which I don't want. 我正在使用Visual Studio 2010,并且在发布项目时注意到,发布目录中的所有文件也都在我不希望的源代码控制之下。 When I looked at one of my other projects under source control I noticed it didn't have the .hg folder and publishes without issue. 当我在源代码控制下查看我的其他项目之一时,我注意到它没有.hg folder并且发布时没有问题。 I then removed the .hg folder and I was able to build and publish and the files were no longer under source control BUT now my project isn't either. 然后,我删除了.hg folder并且能够构建和发布,并且文件不再受源代码控制,但现在我的项目也不受控制。 I put back the .hg folder and I'm back where I started. 我放回.hg folder然后回到开始的地方。 How do I remove the .hg folder from my project but still retain source control? 如何从项目中删除.hg文件夹,但仍保留源代码管理?

The .hg directory cannot be removed. .hg目录无法删除。 It contains everything Mercurial knows about your project. 它包含Mercurial关于您的项目的所有知识。 Deleting that directory effectively removes all source control. 有效地删除该目录将删除所有源代码管理。

Add files you don't want to be tracked to the .hgignore file in the root of your repository instead. 将不需要跟踪的文件添加到存储库根目录中的.hgignore文件。 See the hgignore documentation for the format of this file. 有关此文件的格式,请参见hgignore文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM