【问题标题】:How can I add pattern that start with hash to gitignore [duplicate]如何将以哈希开头的模式添加到 gitignore [重复]
【发布时间】:2012-08-10 13:14:52
【问题描述】:

当我使用 Emacs 时,它会创建像 #foo.txt# 这样的临时文件,我如何向 .gitignore 添加模式以忽略这些文件(# 被 git 解释为 .gitignore 中的注释)

【问题讨论】:

    标签: git emacs gitignore temporary-files


    【解决方案1】:

    尝试转义 # 字符:

    $ cat .gitignore
    \#*.txt\#
    

    我希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2023-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-03
      • 2015-04-21
      • 2015-12-03
      • 2020-03-01
      • 2012-09-03
      相关资源
      最近更新 更多