我曾经和我的团队一起做一个项目,我们在迁移到 git 之前使用 svn 进行版本控制,现在 svn 的历史早已不复存在。我有我们开始使用的原始资源,我希望它出现在 git 历史记录中,这样我就可以看到我们从 git 或 IDE 所做的更改。
为了能够做到这一点,我必须能够将原始资源放在现有提交之下而不保留任何内容。
现在的历史是怎样的:
- 添加自述文件
- 添加新来源
- 改变 1
- 改变 2
- ...
我希望它看起来如何:
- 添加自述文件
- 添加旧资源
- 添加新来源
- 改变 1
- 改变 2
- ...
我们还删除或重命名了许多文件,我不希望它们属于存储库的当前状态。我能做的最好的事情是检查新分支上的自述文件提交,将旧源放在它上面,然后使用他们的策略将 master 合并到分支中以覆盖文件。我可以将旧源视为第二次提交,然后在最后一次更改之上进行合并提交。它保留已删除或重命名的文件,并且不显示现有文件的历史记录。
这甚至可以在不必重建整个回购的情况下完成吗?