What is the difference between hg forget and hg remove?

前端 未结 5 827
南旧
南旧 2020-11-28 01:52

I want mercurial to remove several files from the current state of the repository. However, I want the files to exist in prior history.

How do forget an

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 02:27

    If you use "hg remove b" against a file with "A" status, which means it has been added but not commited, Mercurial will respond:

      not removing b: file has been marked for add (use forget to undo)
    

    This response is a very clear explication of the difference between remove and forget.

    My understanding is that "hg forget" is for undoing an added but not committed file so that it is not tracked by version control; while "hg remove" is for taking out a committed file from version control.

    This thread has a example for using hg remove against files of 7 different types of status.

提交回复
热议问题