任务是从本地 svn 工作目录迁移到 git 存储库并上传到远程 github。
系统: 视窗 10 64 位
git-svn 版本: 2.21.0.windows.1 (svn 1.9.7)
1-我安装了TortoiseGit并尝试应用git克隆命令并提供源以指向github网址
username:tokem@github.company.com/repo.git
我收到此错误:"使用现有的 [svn-远程"svn"] svn-remote.svn.fetch 已设置为跟踪 :refs/remotes/git-svn">
2-使用GitBatch我运行:
svn log -q svnurl | grep '^r[0-9]' | awk '{print $3}' | sort | uniq > authors.txt
我正确地得到了作者.txt 然后我运行:
git config --global --unset http.proxy
和
git svn clone file:///C/Users/Documents/GitHub/Repo --authors-file=C://authors.txt C://Users//Documents/GitHub/Repo_Git
我得到了同样的错误: git-svn windows 使用现有的 [svn-remote "svn"] svn-remote.svn.fetch 已设置为跟踪 :refs/remotes/git-svn
到目前为止,我无法将本地 svn 克隆到 git 然后上传到 github,请帮忙
我阅读了 git-svn 文档并阅读了 svn2git 工具指南,但没有帮助!
提前感谢, 玛丽亚
如果你要在 git 和 svn 之间推送/拉取提交,git-svn
更适合。对于直接导出,svn2git
是一个更好的解决方案,而且速度更快。
https://github.com/svn-all-fast-export/svn2git
GitHub 在其源代码迁移工具帮助页面中推荐了一些工具。
警告:有几个"svn2git"工具:
- 此 GitHub 帮助页面上推荐的那个是用 Ruby 实现的。
- https://stackoverflow.com/a/55475018/6352677 中的那个在 C++ 中实现。