在Hg中,如何忽略包含一些已经跟踪的目录和文件的目录?

时间:2012-09-05 23:41:08

标签: mercurial

在Hg中,如果已经跟踪了某些子目录和包含的文件,如何递归地忽略目录?我想将它们保存在我的文件系统中,但不要对它们进行版本控制。我不想从文件系统中删除该目录。

1 个答案:

答案 0 :(得分:1)

您可以使用hg forget dir_name/以递归方式停止跟踪名为dir_name的目录。

有关hg forget的更多信息:

hg forget [OPTION]... FILE...

forget the specified files on the next commit

    Mark the specified files so they will no longer be tracked after the next
    commit.

    This only removes files from the current branch, not from the entire
    project history, and it does not delete them from the working directory.

    To undo a forget before the next commit, see "hg add".

    Examples:

    - forget newly-added binary files:

        hg forget "set:added() and binary()"

    - forget files that would be excluded by .hgignore:

        hg forget "set:hgignore()"

    Returns 0 on success.

options:

 -I --include PATTERN [+] include names matching the given patterns
 -X --exclude PATTERN [+] exclude names matching the given patterns
    --mq                  operate on patch repository