Trying to ignore the annoyingly-named "TextMesh Pro" directory, underneath an "Assets" folder (full path from the root where .gitignore resides is "Sky Labyrinth\Assets\Text Mesh Pro\").
I followed the suggestions in 3 threads (one, two, three) unsuccessfully.
In the actual .gitignore file I tried:
TextMesh Pro/
TextMesh\ Pro/
**/TextMesh Pro/
**/TextMesh\ Pro/
\Assets\TextMesh Pro\
\Assets\TextMesh/ Pro\
**\Assets\TextMesh Pro\
**\Assets\TextMesh/ Pro\
"\TextMesh Pro\"
"**\TextMesh Pro\"
And a bunch of other combinations that I didn't expect to work (that did indeed not work).
The files are not cached, I have never committed anything from that directory. Just to be sure, I ran:
git rm -r --cached "Sky Labyrinth\Assets\Text Mesh Pro\"
which did not match anything. Just to be doubly sure, I ran
git reset --hard
and re-imported the asset. There is a minor caveat I guess, I did commit a .Unity scene change that had some TextMesh Pro gameobjects inside it; despite my lack of expert Git knowledge I'm pretty sure that shouldn't magically make stuff inside the Assets\TextMesh Pro\ directory get cached or somehow un-ignorable.
Any ideas on how to correctly ignore an entire sub-directory that has whitespace inside the name? I don't need to ignore specific files inside it, I want the whole thing ignored. I understand that as a workaround I could either:
Manually remove the whitespace from the directory name - but anytime I update the plugin I have to repeat this
Make another .gitignore inside the \TextMesh Pro\ directory that ignores everything inside with
/*
which will be my last resort since it's the only thing I've gotten to work. However I'd prefer to understand how to correctly deal with whitespaces in directory names, or learn that it's simply not possible if that's the case.
To ignore an entire directory place a . gitignore of “*” there.
gitignore file is usually placed in the repository's root directory. However, you can create multiple . gitignore files in different subdirectories in your repository.
gitignore file is a plain text file that contains a list of all the specified files and folders from the project that Git should ignore and not track. Inside . gitignore , you can tell Git to ignore only a single file or a single folder by mentioning the name or pattern of that specific file or folder.
Correct answer is:
TextMesh*Pro/
**/TestMesh Pro/
Should also work
It seems that you have missed one of the spaces between Text and Mesh. Try adding
Assets/Text\ Mesh\ Pro/
to your .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