美文网首页
svn项目迁移到git

svn项目迁移到git

作者: kyle背背要转运 | 来源:发表于2018-06-05 21:07 被阅读0次

历史原因,我司部分前端项目在svn托管。在重构和迁移并行的情况下,开启了svn项目迁移git的操作。
目前已迁移完成,最好的迁移方式是找OP帮忙要一台同网段的机器,比如svn是 svn://191.168.1.1 ,这台机器的地址就应该是192.168.1.2。ssh登录上去,然后那速度杠杠的参考我们4w的svn version大概1小时就搞定了,如果机器还有云服务机器,那岂不是爽歪歪啦,这进行git svn clone才是最佳的迁移方式。

本来以为 按照 https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git 一步一步来即可,
没想到遇到的问题还真不少,不知道是sierra问题还是怎么了

git svn clone 参数解释

r指定起止版本号。
no-metadata阻止git导出SVN包含的一些无用信息。
authors-file必须指定svn帐号在git中的映射。
trunk指定导出仓库的主干项目路径。
branches指定svn的分支项目路径。

问题1

Can't locate SVN/Core.pm in @INC (you may need to install the SVN::Core module)

问题1-解决方案

xcode-select --install // 我本机是有xcode的。。
$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/SVN /System/Library/Perl/Extras/5.18/SVN
$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/auto/SVN/ /System/Library/Perl/Extras/5.18/auto/SVN

问题2

/System/Library/Perl/Extras/5.18/SVN: Operation not permitted

问题2-解决方案

1. 重启按 Command+R,进入恢复模式,打开Terminal。 
2. 键入命令 csrutil disable 
3. 重启
4. 再执行 【问题1】命令

问题3

Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
error: The last gc run reported the following. Please correct the root cause
and remove .git/gc.log.
Automatic cleanup will not be performed until the file is removed.

warning: There are too many unreachable loose objects; run 'git prune' to remove them.

gc --auto: command returned error: 255

问题3-解决方案

cd 进入到你的git文件夹,
执行 git prune
再执行 git svn fetch

问题4


error: invalid object 101231 1f123...88basd for 'XXXX'
fatal: git-write-tree: error building trees
write-tree: command returned error: 128

问题4-解决方案

git svn gc


问题5

git clone 结束后,发现目录里面是空,
但是.git文件夹又包含log贼大,是因为没有获取文件
所以要重新获取下文件才行

问题5-解决方案

git svn clone -r HEAD <url>/root/projectA 

相关文章

  • SVN迁移Git

    参考:GIt - 迁移到Git 构建user.txt 关联svn用户和git用户。 用git svn导入svn库 ...

  • git上传报错总结

    背景:公司要把项目都从svn迁移到git上 遇到的问题: POST git-receive-pack (chunk...

  • svn项目迁移到git

    历史原因,我司部分前端项目在svn托管。在重构和迁移并行的情况下,开启了svn项目迁移git的操作。目前已迁移完成...

  • svn项目迁移到git

    前言 最近刚把公司项目从svn迁移到了git上,在这里做个记录 数据迁移 执行上面的步骤就可以将svn项目导出到本...

  • SVN项目迁移到GIT

    svn有很多优点,但是git的出现对svn的冲击的确很大,现在很多公司项目的都迁移的git上了,下面是我自己在做s...

  • SVN 项目迁移到GIT

    为了统一、规范开发流程,以及CICD的推进,将SVN整体迁移至git环境,需要将历史记录同步到git 本文参考了以...

  • svn迁移到git

    SVN迁移到Git svn目录结构 先来看看svn目录结构,这个会关系到我们如何迁移。以下说的都是单个项目的迁移。...

  • Git常用命令

    最近项目从SVN迁移到Git上了,学习了使用Git命令进行了整理我 Git 图形化工具Sourcetree用的还不...

  • Git使用

    因公司项目从SVN整体迁移到Git,故记下Git的使用相关。 1、下载安装git; 2、创建新的仓库。创建新的文件...

  • svn项目迁移到git 初探

    一、从svn导出项目 使用命令(地址可以是svn开头,也可以是http,https): git svn clone...

网友评论

      本文标题:svn项目迁移到git

      本文链接:https://www.haomeiwen.com/subject/reeysftx.html