简体   繁体   English

如何将本地svn工作目录克隆到git repo并上传到github?

[英]How to clone local svn work directory to git repo and upload to github?

The task is to migrate from local svn work directory to git repository and upload to remote github. 任务是从本地svn工作目录迁移到git存储库并上传到远程github。

System: Windows 10 64 bit 系统:Windows 10 64位

git-svn version: 2.21.0.windows.1 (svn 1.9.7) git-svn版本:2.21.0.windows.1(svn 1.9.7)

1- I installed TortoiseGit and try to apply git clone command and provide the origin to point to the github url using 1-我安装了TortoiseGit并尝试应用git clone命令并使用以下命令提供源以指向github网址

username:tokem@github.company.com/repo.git 用户名:tokem@github.company.com/repo.git

I got this error: "Using existing [svn-remote "svn"] svn-remote.svn.fetch already set to track :refs/remotes/git-svn" 我收到此错误:“使用现有的[svn-remote“ svn”] svn-remote.svn.fetch已设置为跟踪:refs / remotes / git-svn”

2- Using GitBatch I run: 2-使用GitBatch运行:

svn log -q svnurl | grep '^r[0-9]' | awk '{print $3}' | sort | uniq > authors.txt

I got the authors.txt correctly then I run: 我正确地获得了authors.txt,然后运行:

git config --global --unset http.proxy 

and

git svn clone file:///C/Users/Documents/GitHub/Repo --authors-file=C://authors.txt C://Users//Documents/GitHub/Repo_Git

I got the same error: git-svn windows Using existing [svn-remote "svn"] svn-remote.svn.fetch already set to track :refs/remotes/git-svn 我遇到了同样的错误:git-svn windows使用现有的[svn-remote“ svn”] svn-remote.svn.fetch已设置为跟踪:refs / remotes / git-svn

Till now I couldn't clone local svn to git and then to upload to github, please help 到目前为止,我无法将本地svn克隆到git,然后再上传到github,请帮助

I read git-svn documentation and read svn2git tool guide but don't help! 我阅读了git-svn文档并阅读了svn2git工具指南,但无济于事!

Thanks in advance, Mariam 预先感谢,玛丽亚姆

git-svn is better suited if you're going to push/pull commits between git and svn. 如果您要在git和svn之间进行推/拉提交,则git-svn更适合。 For a straight export, svn2git is a much better solution and way faster. 对于直接导出, svn2git是一个更好的解决方案,并且速度更快。
https://github.com/svn-all-fast-export/svn2git https://github.com/svn-all-fast-export/svn2git

GitHub recommends a few tools in their Source code migration tools help page. GitHub在其源代码迁移工具帮助页面中推荐了一些工具。

Warning: there are several "svn2git" tools: 警告:有几种“ svn2git”工具:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM