How do I fix an invisible file name?

I can open it in Notepad, and it shows the filename as .gitignore, but it shows up like this:


Google gives me tutorials on how to accomplish this, but I want the inverse.

  • 1
    Have you tried to rename the file? Jul 12, 2014 at 11:28
  • 5
    Can you clarify what you mean by fixing? As pointed out by the answers, the filename only has an extension and you have a setting active to hide known extensions. Showing all extension gives your icon a name, but I'm not sure that is a "fix" in your books, because technically speaking, nothing is broken. Also, do note that if this file is located on a network share running linux, the file will be hidden in addition, because files starting with a . are samba's way of saying the file is marked as hidden.
    – LPChip
    Jul 12, 2014 at 13:21
  • 3
    How is this not a duplicate 5 years after Super User was launched? Jul 12, 2014 at 13:57
  • Lol, isn't Windows great. For some reason, I'm hoping you're not trying to push to that repository (to which this file belongs, assuming there is a remote branch). I've seen too many broken files from Windows users (usually broken linebreaks and encoding, causing all kinds of problems). No offense.
    – basic6
    Jul 12, 2014 at 15:22
  • @basic6 None taken. No the files are alright to push.
    – LRNAB
    Jul 12, 2014 at 16:25

4 Answers 4


I suspect it's because it's a "known extension" and you have those hidden.

Open Windows Explorer and go to Organize => Folder and search options => View tab => untick Hide extensions for known file types.

GIF showing process

  • Would never think that it's the whole name understood as a name extension :)
    – Ruslan
    Jul 12, 2014 at 14:51
  • 9
    I wish MS would stop making this "feature" on by default. It's the first thing power users deactivate, and regular users never know they're opening a malware called harmless text file.txt.exe, because they don't see the .exe extension.
    – Nolonar
    Jul 12, 2014 at 19:02
  • @Nolonar Better yet, it's on by default in the Server editions too. As for why anyone running Server would need or want it... well, don't ask me.
    – Bob
    Jul 13, 2014 at 1:24

I second the suggestion of unchecking "Hide extensions for known file types".

This "feature" is not really useful, may be annoying (as in this case), and not really safe - figure out the classic scam virus attachment, an executable called SomeText.txt(.exe, hidden) with same icon of system .txt files!

Otherwise, you can rename the file from command prompt or from GUI using F2, but be sure no application is pointing to it or will not find it after renaming.


It's not invisible, it simply does not exist: this file only has an extension.

BTW, Windows does not allow creating such files from the file explorer, only command prompt.

  • But it does allow making them via e.g. notepad. Just select "All files" in save dialog file type filter and enter the name like .testfile.
    – Ruslan
    Jul 12, 2014 at 14:59

Windows doesn't really like filenames that start with a dit (.). I get around this by dropping the leading dot and supplying a .txt extension.

After uploading to the server I rename the file. Many SFTP clients allow you to do this with a right click. From a shell you would use something like:

mv getignore.txt .getignore
  • 1
    Windows does really like them, it's just that some of default apps don't understand them. Such names are incompatible with Win32 subsystem of NTFS, but they are easily created and manipulated via POSIX subsystem.
    – Ruslan
    Jul 12, 2014 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.