23

How can I create this file in a directory in windows 2003 SP2:

.hgignore

I get error: You must type a file name.

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229
Christopher Mahan
  • 7,621
  • 9
  • 53
  • 66
  • 11
    This is not related to software development? How to make an ignore file on windows server for mercurial? What is it related to, then, masonry and plumbing? – Christopher Mahan Mar 21 '11 at 18:54
  • Relevant: http://blog.stackoverflow.com/2013/06/the-war-of-the-closes/ I mean, a more helpful way to deal with this issue would have been to migrate the question to Super User. Anyway, I found the question and answer useful, so I gave them upvotes. – Excrubulent Jun 26 '13 at 13:51
  • Related post on the desired forum - [Create/rename a file/folder that begins with a dot in Windows?](https://superuser.com/q/64471/374397) – RBT Mar 22 '19 at 05:50

2 Answers2

27

That's a "feature" of Windows Explorer. Try to create your files from a command line (or from a batch/program you wrote) and it should work fine. Try this from a dos prompt:

echo Hello there! > .hgignore
Ishmaeel
  • 14,138
  • 9
  • 71
  • 83
5

By the way Raymond Chen had a blog post about this topic a while back:

Why doesn't Explorer let you create a file whose name begins with a dot? (archive.org link with comments: https://web.archive.org/web/20100305064616/http://blogs.msdn.com/oldnewthing/archive/2008/04/14/8389268.aspx)

In which he mentions

You can do it from the command line or use your favorite file management tool.

Joshua
  • 40,822
  • 8
  • 72
  • 132
Pat
  • 36,282
  • 18
  • 72
  • 87