9

When I work with Emacs it create temporary files like #foo.txt# how can I add pattern to .gitignore that will ignore those files (# is interpreted by git as comment in .gitignore)

jcubic
  • 56,835
  • 46
  • 206
  • 357

1 Answers1

14

Try escaping the # character:

$ cat .gitignore
\#*.txt\#

I hope this helps.

jsbueno
  • 86,446
  • 9
  • 131
  • 182
mamapitufo
  • 4,400
  • 2
  • 23
  • 19