Mercurial .hgignore for C# and VB .net Projects

There’s certain files and folders that you don’t want to put into source control. With Mercurial all you need is a .hgignore file in the root path of your project. A simple windowsy way of doing this is (from a command line) is by typing

notepad c:\path_to_code\.hgignore

This will create the file so now simply add the following lines to the file:

# use glob syntax.
syntax: glob
 
# Misc Mac/Windows stuff
 
.DS_Store
Thumbs.db
Desktop.ini
 
# builds
 
*.exe
*.ex_
 
# vb6
 
*.SCC
*.vbw
*.pdb
*.log
*.Log
 
# c-sharp
#ProjectName/bin
#ProjectName/obj
*.user
*.suo
_ReSharper.*
*.sln.cache

Note: You need to change #ProjectName to your project foldername.

Now feel free to init/add/commit:

hg init
hg add
hg commit -m "Initial Commit with ignores"

Tags:

Comments are closed.