Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use "!" in .gitignore as a string

Tags:

git

gitignore

I have directory which starts with exclamation mark, like:

!test

I want to add it in gitignore, but this doesn't seem to work:

\!test

What is the correct way to do this?

like image 628
Eugene Avatar asked Feb 15 '23 12:02

Eugene


1 Answers

You can escape it with a backslash => \!test

like image 155
peko Avatar answered Feb 18 '23 09:02

peko