将源代码历史记录从git导入tfs时重新设置问题

时间:2018-07-03 15:22:19

标签: git rebase git-tfs

我们的源代码最初位于TFS的TFVC存储库中。几年前,我们使用git-tfs将所有存储库从TFS迁移到git。效果非常好,使我们的所有历史记录与代码一起移了过来,我对结果感到非常满意。

现在,我们的IT组织已合并为另一个不熟悉git且仅使用TFVC的组织(因此,在TFS中使用git repo实际上不是一种选择)。为了方便起见,我想保留历史。

所以我制定了一个(通常)有效的脚本,它就像这样

从一个几乎是裸露的TFS存储库中(我们检入一个文件,以便它具有git tfs可以抓住的提交ID。该文件与实际存储库中的任何文件都不冲突)

git tfs clone <tfs root> <tfs repo/branch> <projectname-tfs>
git clone <git repo> <projectname-git>

#From the git repo
#Remove all previous git tfs message ids, they tend to confuse things
git filter-branch --msg-filter 'sed "s/git-tfs-id/Old-TFS/g"'
git remote add tfs <path to local tfs repo>
git fetch tfs
# Rebase all of our changes so that they are on top of the TFS repo
git rebase tfs/master

#From the tfs repo
git remote add bitbucket <path to local git repo>
git fetch bitbucket
git merge bitbucket/master
git tfs rcheckin

此过程在一些存储库中运行良好。但是,对于其他用户,在执行重新设置基准时遇到合并冲突。我不想手动重新解决我们所有存储库中发生的每个合并冲突,有没有办法让它在重播提交时仅采用最初提交的内容?

0 个答案:

没有答案
相关问题