Gregg
Gregg

Reputation: 1

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. 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. 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. I put back the .hg folder and I'm back where I started. How do I remove the .hg folder from my project but still retain source control?

Upvotes: 0

Views: 410

Answers (1)

Martijn Pieters
Martijn Pieters

Reputation: 1122342

The .hg directory cannot be removed. It contains everything Mercurial knows about your project. 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. See the hgignore documentation for the format of this file.

Upvotes: 3

Related Questions