How to stop tracking a file without deleting it on Mercurial

前端 未结 1 1934
半阙折子戏
半阙折子戏 2021-01-01 11:47

I saw this thread which discusses a solution for git, and found this thread on the mailing list for Mercurial (the thread is four years old though)

The

相关标签:
1条回答
  • 2021-01-01 12:49

    You can just use hg forget or maybe add the file to your .hgignore file

    And to answer the last question about the R in my_file. If you see the help for hg rm --help:

    hg remove [OPTION]... FILE...

    aliases: rm

    remove the specified files on the next commit

    Schedule the indicated files for removal from the current branch.
    
    This command schedules the files to be removed at the next commit. To undo
    a remove before that, see "hg revert". To undo added files, see "hg
    forget".
    
    Returns 0 on success, 1 if any warnings encountered.
    

    options:

    -A --after record delete for missing files
    -f --force remove (and delete) file even if added or modified
    -I --include PATTERN [+] include names matching the given patterns
    -X --exclude PATTERN [+] exclude names matching the given patterns

    [+] marked option can be specified multiple times

    use "hg -v help remove" to show more info

    As you can see you are forcing the deletion of that file and that's why you can see the R (Removed)

    0 讨论(0)
提交回复
热议问题