I want to add emacs autosave files to my .gitignore with the glob #*# but of course, lines starting with a hash are comment lines.
#*#
How can I get this in
Another way of escaping # is to use the character set syntax, so that your #*# glob becomes
#
[#]*[#]
in your .gitignore file.
.gitignore