将Git Repo与源SVN存储库同步:无法确定工作树历史记录中的上游SVN信息

时间:2014-07-03 11:58:16

标签: git svn synchronization rebase

同步从Git克隆的新SVN存储库时遇到以下错误。我知道有很多关于这个主题的帖子,当然我已经阅读过了,但似乎没有一个与我的情况相符:

方案:
我必须将包含历史记录的大型项目SVN存储库迁移到Git。在一段时间内,旧的SVN存储库被进一步使用,而新的Git存储库必须同步(单向svn - > git),直到我们最终切换到GIT

迁移步骤:

# checkout svn repo to extract info
svn co svn://host_of_svn_repo/svn_repo_name
# extract author info
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
# migrate svn repo to git
git svn clone svn://host_of_svn_repo/svn_repo_name --no-metadata -A authors-transform.txt --stdlayout ../my_new_git_repo
cd ../my_new_git_repo
# look for needed branches to migrate
git branch -av
# [-> foreach] branch to migrate, checkout
git checkout -b branchname-svn remotes/branchname
# configure new git remote repository
git remote add origin http://git_repo_host/git_repos_name
# push master branch
git push -u origin master
# [-> foreach] branch to migrate, push it
git push origin branchname

现在,原始SVN存储库获得了一个新的提交,所以我希望像这样同步我的新Git存储库:

git svn fetch

会产生类似

的结果
     A            images/a_new_image.png
r4445  = 12412464563574736573486dgtwsegt7324 (refs/remotes/trunk)

然后完成我想要改变:

git svn rebase

我遇到以下错误:

Unable to determine upstream SVN information from working tree history

感谢任何帮助!

0 个答案:

没有答案
相关问题