小编use*_*973的帖子

使用git filter-branch拆分repo:如何从重命名/移动的文件中恢复历史记录?

免责声明:我已经看到Detach(move)子目录进入单独的Git存储库,但它没有完全回答这个问题.

我已经将一个项目从svn迁移到git.当它存在于svn中时,一些文件被移动和/或重命名.

在git迁移之后,一些提交只能在 git log --follow

所以:

git结构如下:

MyMainRepo/
.git/
XYZ/
ABC/myFile.txt
Run Code Online (Sandbox Code Playgroud)

git log ABC/myFile.txt show: - commit1 - commit2

git log --follow ABC/myFile.txt 显示: - commit1 - commit2 - commit3(那时ABC目录不存在)...

现在,当拆分git repo以获得一个独特的ABC git repo时: git log --follow ABC/myFile.txt现在丢失了旧的历史记录,我只是:

  • commit1
  • commit2

我想要的是什么:

  • 从MyMainRepo拆分ABC,
  • 不要失去历史

欢迎任何帮助:)

svn git history git-filter-branch

5
推荐指数
1
解决办法
999
查看次数

标签 统计

git ×1

git-filter-branch ×1

history ×1

svn ×1