钉钉、微博极速扩容黑科技,点击观看阿里云弹性计算年度发布会!>>>
问题:
I would like to rename/move a project subtree in Git moving it from 我想在Git中重命名/移动项目子树,将其从
/project/xyz
to 至
/components/xyz
If I use a plain git mv project components
, then all the commit history for the xyz project
gets lost. 如果我使用普通的git mv project components
,那么xyz project
所有提交历史记录都会丢失。 Is there a way to move this such that the history is maintained? 有什么办法可以移动历史记录吗?
解决方案:
参考一:https://stackoom.com/question/9i96/是否可以在Git中移动-重命名文件并维护其历史记录
参考二:https://oldbug.net/q/9i96/Is-it-possible-to-move-rename-files-in-Git-and-maintain-their-history