Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't .gitignore.txt file show it's name in windows10?

Recently I scaffolded a project with webapp generator. It created two files .gitignore and .gitattributes. Both show a file extention of type Text Document But when I press F12 to edit any one's name then it has empty name. Here is the snapshot:

enter image description here

My question is why don't window show the name as .gitignore?

like image 268
6questions24hour Avatar asked Feb 11 '17 07:02

6questions24hour


People also ask

Can a Gitignore file have a name?

If you want to use one, pick it, drop it in your repository and rename it to . gitignore . git recognizes only two places for listing ignored files: . gitignore files in a folder/subfolder and the file .

Why does .gitignore not work?

Some times, even if you haven't added some files to the repository, git seems to monitor them even after you add them to the . gitignore file. This is a caching issue that can occur and to fix it, you need to clear your cache.

Why is my file not being ignored in Gitignore?

gitignore ignores only untracked files. Your files are marked as modified - meaning they were committed in the past, and git now tracks them. To ignore them, you first need to delete them, git rm them, commit and then ignore them.


4 Answers

There is nothing special with those files. This visual guide may help you.

Windows Folder Options Image

Also in Windows 10 you may simply try this option in View Tab of Folder Explorer:

enter image description here

like image 61
Hossein Narimani Rad Avatar answered Oct 23 '22 10:10

Hossein Narimani Rad


After looking and reading closer, it seems that the "problem" is that with the default settings of Explorer "known" file-name extensions (like e.g. .txt) are just not shown.

So if you name a file .txt (full file-name) then it will show up as empty and with no name.


Dot-files are not having any "extension" to their file-name. The full file-name of e.g. the Git ignore file is .gitignore.

It comes from the Unix world where file-names doesn't have to follow the DOS and Windows name.ext scheme, and means that the file is hidden.

Windows since long allows arbitrary file-names as well, but in a name.ext scheme such files doesn't have a "name" only an extension.

like image 20
Some programmer dude Avatar answered Oct 23 '22 11:10

Some programmer dude


Windows interprets .gitignore as an empty file name with the extension "gitignore", and thus shows an empty name be default. To properly see its name, open the folder's properties and check the "Show All File Extensions" option.

like image 36
Mureinik Avatar answered Oct 23 '22 09:10

Mureinik


I don't have an answer, but I have a preference. I'd prefer not to show all extensions just to be able to see my .gitignore files in Windows10 file explorer.

I'm hoping to extend OP's question by showing I DO SEE .babelrc and .eslintrc, and w/o seeing all file extension setting being set to "on".

It seems, on my own system, that the associations for BABELRC and ESLINT(RC|IGNORE) are, maybe, set automatically by VSCode? In any case, why can I see those "." files, while the in.json is showing with hidden extension, but I can't see .gitignore?

windows file explorer screen shot where .gitignore shows as blank

evidence screen shot showing the .gitignore is indeed present

like image 33
Neil Guy Lindberg Avatar answered Oct 23 '22 09:10

Neil Guy Lindberg