Search code examples
gitglobgitignore

Adding a file to .gitignore with a $ in its filename?


How do you .gitignore a file with a $ in its filename?

Does it need to be escaped somehow?


Solution

  • You don't need to escape $

    Add into .gitignore this

    foo$bar
    
    

    to ignore foo$bar file

    NB: By the way you should use \ to escape

    foo\$bar
    

    will work but this is not necessary