如何将Google代码上的SVN repo迁移到GitHub上的git repo
我很难从code.google上托管的SVN存储库切换到github上的git repo。具体而言:如何将Google代码上的SVN repo迁移到GitHub上的git repo,git,svn,github,Git,Svn,Github,我很难从code.google上托管的SVN存储库切换到github上的git repo。具体而言: 如何在保留修订历史记录的同时将code.google上的代码从SVN更改为GIT 如何在保留修订历史记录的同时,将code.google上的wiki从SVN更改为GIT 如何将GIT存储库从code.google移动到GitHub 我如何保持这两个存储库彼此同步,同时仍然使用GitHub作为主要repo 变量: $project是您的项目名称 $username是您在github上的用户名
- $project是您的项目名称
- $username是您在github上的用户名
mkdir github
cd github/
git clone https://code.google.com/p/$project.git
cd $project/
git remote set-url origin https://github.com/$username/$project.git
git pull
git push origin master
git remote set-url --add origin https://$project.googlecode.com/git
touch test.txt
git add test.txt
git commit -m "Testing repo replication" test.txt
git push
git remote set-url --add origin https://$project.googlecode.com/git
touch test.txt
git add test.txt
git commit -m "Testing repo replication" test.txt
git push
注意:如果您在其他位置(如不同的计算机)再次克隆,则必须再次重复步骤6 现在谷歌代码上有一个导出功能-进入你的项目的谷歌代码页面,即
Code.Google.com/p/yourproject
,然后你会看到一个按钮“导出到GitHub”,它将分两步完成(注意:你需要用你的GitHub帐户进行授权)
请注意,您可以为任何项目执行此操作,而不仅仅是您自己的项目