Hg: How to move files (to subfolder) without losing history?

前端 未结 4 538
逝去的感伤
逝去的感伤 2021-02-02 05:43

How to move files (to subfolder) without losing their history?

In my Mercurial repository (I mean the folder with the .hg in it) I have MyProject/ folder with all projec

4条回答
  •  春和景丽
    2021-02-02 06:26

    hg mv 
    

    does do the right thing, but hg log does not list entries past the move unless you give it the -f option. See this question for more info

    Why 'hg mv' (mercurial) doesn't move a file's history by default?

    After you do this, you likely want to add the -f option to hg log to the hgrc file for the repo.

    .hg/hgrc
    
    [defaults] 
    log = -f 
    

提交回复
热议问题