I wish to ignore only one file without extension. I am able to ignore some files by names, but they all have extensions. Unfortunately I work with some files without extension that should not be ignored; thus, I can not use the solution provided here How do I add files without dots in them (all extension-less files) to the gitignore file?.
Does anybody know a way to achieve this? Any help is appreciated.
You might be making this more complex than it has to be. This could possibly be due to the answer you cited which ignores all extensionless files. To ignore a file without an extension does not appear to be very different than ignoring a file with an extension. To ignore your single file without an extension add this to your .gitignore
:
relative/path/to/your/file
If the file had an extension, you would just add this:
relative/path/to/your/file.ext
Based on this Gist https://gist.github.com/chichunchen/970a7e97c74a253a4503
Include the next 3 lines in the beginning of your .gitignore
# Ignore all
*
# Unignore all with extensions
!*.*
# Unignore all dirs
!*/
hope it helps
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