简体   繁体   English

我可以将我的项目源从svn存储库克隆到Git存储库

[英]can i clone my project source from svn repository to Git repository

SVN repository in: svn://server/myPath/svn/repos SVN存储库位于: svn://server/myPath/svn/repos

Git repository in: git://server/myPath/git/repos Git存储库: git://server/myPath/git/repos

I'm trying to clone the svn project so I used this command: git svn clone svn://zone.spip.org/spip-zone gitzone 我正在尝试克隆svn项目,所以我使用了这个命令:git svn clone svn://zone.spip.org/spip-zone gitzone

and I got a strange error message: error: git-svn died of signal 6 我得到一个奇怪的错误信息:错误:git-svn死于信号6

If you are going to keep the code in SVN why don't you just 如果你要将代码保存在SVN中,为什么不呢

git svn clone svn://server/myPath/svn/repos git svn clone svn:// server / myPath / svn / repos

As @JohnNY's answer says, you can do git svn clone , and later keep up with the SVN repo by git svn rebase . 正如@ JohnNY的回答所说,你可以做git svn clone ,然后通过git svn rebase跟上SVN repo。 Do read the git svn documentation, there are several useful subcommands (and important caveats!) when interacting with SVN. 请阅读git svn文档,在与SVN交互时有几个有用的子命令(以及重要的注意事项!)。 git svn clone is slow as molasses (yes, a modest size repository can well take more than a day!); git svn clone作为糖蜜很慢(是的,适度的大小存储库可能需要超过一天!); if several people need access, clone once and distribute eg tarballs of the cloned repository. 如果有几个人需要访问,请克隆一次并分发例如克隆存储库的tarball。 Or ditch SVN. 或者沟渠SVN。 Just sayin'. 只是在说'。

If you want to clone your old SVN repo and then move it into git I did it the following why. 如果你想克隆你的旧SVN仓库,然后将其移动到git我做了以下原因。

git svn clone svn://server/myPath/svn/repos/trunk myproject.git

or 要么

git svn clone -s svn://server/myPath/svn/repos myproject.git

then 然后

cd myproject.git 

I did NOT want the history so I then removed the git folder 我不想要历史,所以我删除了git文件夹

rm -rf .git/

then 然后

git init
git add .
git commit -a
git remote add origin git@git:<project>.git
git push -u origin master

and your now done and ready to use it as git 而你现在已经完成并准备将它用作git

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

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