如何 git 忽略以 # 符号开头的文件夹

How to git ignore folders that begin with # sign

是否可以创建一个 .gitignore 文件,忽略以 # 开头的文件或文件夹?

示例:

#DATABASE_FILES
#DOCUMENTATION

documentation 指定:

A line starting with # serves as a comment. Put a backslash (\) in front of the first hash for patterns that begin with a hash.

(添加格式)

所以你可以使用:

\#DATABASE_FILES
\#DOCUMENTATION

转义哈希。

转义(在字符前面放置 \)顺便说一下,这是 *nix 世界中使用的一种常用技术(仅对等效问题的提示)。