简体   繁体   中英

In Hg, how to ignore a directory which contain some already tracked directories and files?

In Hg, how to ignore a directory recursively if some of its subdirectories and contained files are already tracked? I'd like to keep them in my file system but don't version control them. I don't want to remove the directory from the file system.

You can use hg forget dir_name/ to stop tracking directory called dir_name recursively.

More info on 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM