是否有一个允许跟踪文件名更改的源代码控制系统?
时间:2020-03-06 15:02:00 来源:igfitidea点击:
因此,我一直在使用我的简历存储库。如果重命名存储库中已经存在的文件,虽然我会错过一件事,但是我需要从那里删除具有旧名称的文件,然后添加新文件。因此,我放弃了所有的变更历史。有时需要在已经存在的现有项目中重命名文件。
从我所看到的,cvs / svn无法处理这样的事情,还是我错了?如果没有,我们会建议使用哪种其他源代码控制系统来重命名文件?
解决方案
Subversion可以做到这一点,但我们必须做到这一点
svn move <oldfile> <newfile>
编辑:在这十年中,我们做git mv <oldfile> <newfile>
,或者只使用mv
,而git通常自行解决。
Subversion具有重命名功能。
几乎所有现代版本控制系统都允许这样做(Subversion,Perforce,Vault,git,Mercurial,TFS等)。
我能想到的唯一不会(或者有重大警告)的是CVS和VSS。
在线CVS手册中有一些有关如何执行此操作的详细信息:
The normal way to move a file is to issue a cvs rename command. $ cvs rename old new $ cvs commit -m "Renamed old to new" This is the simplest way to move a file. It is not error prone, and it preserves the history of what was done. CVSNT clients can retrieve the original name by checking out an older version of the repository.
仅CVSNT服务器2.0.55及更高版本支持此功能。
在svn中,使用svn mv。
另请参阅:常见问题解答中的http://subversion.tigris.org/faq.html#case-change。