【发布时间】:2010-02-26 05:43:12
【问题描述】:
我将 mercurial 用于 php 项目,但我的 .hgignore 文件无法正常工作。它应该放在.hg/ 文件夹中,不是吗?
.hgignore
/.hg/.hgignore file
# Allow *. syntax
syntax:glob
# Ignore these files
.hgignore
.htaccess
.hg/*
【问题讨论】:
我将 mercurial 用于 php 项目,但我的 .hgignore 文件无法正常工作。它应该放在.hg/ 文件夹中,不是吗?
/.hg/.hgignore file
# Allow *. syntax
syntax:glob
# Ignore these files
.hgignore
.htaccess
.hg/*
【问题讨论】:
.hgignore 页面中没有提到该文件在 inside .hg:
.hgignore文件位于工作目录中,在.hg文件夹旁边。
无论您想忽略什么文件,您都必须确保它们尚未被跟踪。如果是,您需要先删除它们,然后将它们添加为私有(非跟踪)文件。
【讨论】:
hg forget <filename> 是您的朋友!
仅凭记忆,我认为 .hgignore 需要存在于存储库根目录中。您当然不需要告诉它忽略 .hg 文件夹,这或多或少会自动发生。有什么理由不希望您的仓库中的忽略和访问设置?
【讨论】: