您可以创建初始的一replacement ref从git的承诺,使其 似乎最git的命令,它起源于Git的历史是建立在从SVN进口的历史 。
您可以用下面的命令做到这一点:
git checkout -b temporary <FIRST_GIT_COMMIT>
# Set parent of next commit to last one from svn,
# but don't change the working tree or contents of next commit
git reset --soft <LATEST_SVN_COMMIT>
# Create a new commit using contents and message of the first git commit
git commit -C <FIRST_GIT_COMMIT>
# Tell git to use the newly created commit in place of the original git
# commit in most cases.
git replace <FIRST_GIT_COMMIT> HEAD
但是,更换引用没有得到自动使用遥控器或者推或拉时 标准refspecs转移。相比,可以 手工完成使用:
git push origin 'refs/replace/*:refs/replace/*'
git pull origin 'refs/replace/*:refs/replace/*'
它是不可能有改变的历史会自动转移到其他 库不改变的每一个提交ID提交其 最初使用Git创建的。
来源
2013-05-10 04:31:07
qqx
“git-only”历史中有多少次提交?你为什么不想重写?重写可能是最干净的解决方案。 – Chronial 2013-05-10 00:59:55