您的位置:首页 > 大数据 > 人工智能

是否可以在Git中移动/重命名文件并维护其历史记录? - Is it possible to move/rename files in Git and maintain their history?

2020-07-15 06:30 1061 查看

钉钉、微博极速扩容黑科技,点击观看阿里云弹性计算年度发布会!>>>

问题:

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  git
相关文章推荐