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:
My question is why don't window show the name as .gitignore
?
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 .
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.
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.
There is nothing special with those files. This visual guide may help you.
Also in Windows 10 you may simply try this option in View Tab of Folder Explorer:
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.
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.
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
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With