汞:如何在不丢失历史记录的情况下移动文件(至子文件夹)? [英] Hg: How to move files (to subfolder) without losing history?
问题描述
如何在不丢失文件历史记录的情况下将文件移动到子文件夹?
How to move files (to subfolder) without losing their history?
在我的Mercurial存储库中(我的意思是其中带有.hg的文件夹),我有MyProject/文件夹,其中包含所有项目文件.现在,我需要在其中创建src/文件夹并将所有文件移至其中(从 MyProject/移至 MyProject/src/).我该怎么做而不丢失所有历史记录?
In my Mercurial repository (I mean the folder with the .hg in it) I have MyProject/ folder with all project files. Now I need to create src/ folder inside and move all files to it (from MyProject/ to MyProject/src/). How can I do it without losing all history?
推荐答案
hg mv
做正确的事,但是hg log
不会列出移动后的条目,除非您
给它-f
选项.有关更多信息,请参见此问题
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
为什么要使用"hg mv"(Mercurial )默认情况下不会移动文件的历史记录?
执行完此操作后,您可能想将-f
选项添加到hg log
到回购的hgrc文件中.
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
这篇关于汞:如何在不丢失历史记录的情况下移动文件(至子文件夹)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!