步骤命令如下:

> git svn clone https://svn-url/ProjectName --no-metadata --authors-file=user.txt --trunk=/ --tags=tags --branches=branches --ignore-refs=refs/remotes/ProjectName-.* 
> cd  ProjectName
> git remote rm origin
> git remote add origin http://git-url/ProjectName.git
> git push -u origin master

 

命令注释:

第一行:复制项目ProjectName从svn到本地git;【注意:user.txt为svn用户对于git的用户文件,格式:xxx = xxx <xxx@xxx.com>.(执行dos命令把user.txt放dos执行路径下);】

  参数–no-metadata表示阻止git导出SVN包含的一些无用信息
  参数–authors-file表示SVN账号映射到git账号文件,所有svn作者都要做映射
  参数–trunkmobile表示主开发项目
  参数–branches表示分支项目,--ignore-refs表示不包含后面的分支项目
  参数ProjectName表示git项目名称

第二行:进入项目;

第三行:可以忽略,移除此文件夹下的源,报错已经存在源的时候,需要执行;

第四行:增加到远程git地址;

第五行:推送到git地址到master版本;

 

相关文章:

  • 2021-08-09
  • 2021-07-15
  • 2021-09-04
  • 2022-12-23
  • 2021-12-30
  • 2018-11-27
  • 2022-12-23
猜你喜欢
  • 2021-07-13
  • 2021-12-30
  • 2022-12-23
  • 2021-05-09
  • 2021-05-16
相关资源
相似解决方案