【问题标题】:Why does .hgignore appears in my patches?为什么 .hgignore 出现在我的补丁程序中?
【发布时间】:2013-06-23 12:58:12
【问题描述】:

我使用 Mercurial 队列来处理补丁。

最初没有.hgignore。 我不确定我是先创建了一个MQ 补丁,然后再创建了我的.hgignore,还是反过来。

(“创建补丁”是指hg qnew patch_name -m "..."

无论如何,在创建MQ 补丁后,我对.hgignore 进行了一些更改

当我执行hg qrefresh; hg export qtip 时,我的补丁中也有.hgignore 的更改内容。 因此,尝试将 .hgignore 条目添加到 .hgignore 本身。但这没有用。更改仍然存在。

所以,我尝试了hg forget .hgignore,这造成了更大的混乱。现在显示我在补丁中删除了 .hgignore。像这样:

--- a/.hgignore
+++ /dev/null
- all 
- the lines of .hgignore
- the lines of .hgignore

我该如何解决这个问题? 我只希望 .hgignore 成为我本地 repo 的一部分,并帮助不跟踪某些文件。

【问题讨论】:

    标签: mercurial hgignore mercurial-queue


    【解决方案1】:

    .hgignore 旨在由 Mercurial (doc) 跟踪。仅在本地克隆中忽略文件的标准方法是使用 ui.ignore 设置:

    # .hg/hgrc
    [ui]
    ignore = /path/to/repo/.hg/hgignore
    

    如果你有多个本地忽略文件,那么你可以写

    [ui]
    ignore.first = /path/to/repo/.hg/firstignore
    ignore.second = /path/to/repo/.hg/secondignore
    

    额外的全局忽略文件可以这样配置:

    [ui]
    ignore.first = /path/to/repo/.hg/firstignore
    ignore.second = /path/to/repo/.hg/secondignore
    ignore.third = ~/thirdignore
    

    所有设置都存在于hgrc 文件中。更多细节在这里:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-09
      • 1970-01-01
      • 2020-12-15
      • 1970-01-01
      • 2013-04-10
      • 1970-01-01
      • 2023-04-02
      相关资源
      最近更新 更多