美文网首页
svn迁移到gitlab

svn迁移到gitlab

作者: 老夫刘某 | 来源:发表于2017-08-29 09:26 被阅读0次

yum install -y git-svn

如果想保留提交记录,可以用下面的命令找到:

[root@centos3 bbs]# svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
<author>guoxiong</author>
<author>liujiangbu</author>

修改格式:

guoxiong = guoxiong  <guoxiong@qq.com>
liujiangbu = liujiangbu  <liujiangbu@qq.com>

从svn上clone出要迁移的项目:

[root@centos3 bbs-bak]# git svn clone  svn://svn.tttttt.com:9600/bbs/  --no-metadata  --authors-file=users.txt^C
[root@centos3 bbs-bak]# ll
total 8
drwxr-xr-x. 14 root root 4096 Aug 29 17:11 bbs
-rw-r--r--.  1 root root   84 Aug 29 17:11 users.txt

[root@centos3 bbs-bak]# cd  bbs
[root@centos3 bbs]# git remote add origin git@10.40.2.74:soa/bbs.git
[root@centos3 bbs]# git push origin --all
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

[root@centos3 bbs]# vim .git/config

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[svn-remote "svn"]
        noMetadata = 1
        url = svn://svn.hqygou.com:9600/bbs
        fetch = :refs/remotes/git-svn
[svn]
        authorsfile = /home/bbs-bak/users.txt
[remote "origin"]                                            #要是没有这两段要加上
        url = http://10.40.2.22/soa/bbs.git       

然后去gitlab上创建改项目:


image.png
[root@centos3 bbs]# git push origin --all
Username for 'http://10.40.2.22': root
Password for 'http://root@10.40.2.74': 
Counting objects: 2349, done.
Compressing objects: 100% (2241/2241), done.
Writing objects: 100% (2349/2349), 5.84 MiB | 3.53 MiB/s, done.
Total 2349 (delta 485), reused 0 (delta 0)
remote: Resolving deltas: 100% (485/485), done.
To http://10.40.2.22/soa/bbs.git
 * [new branch]      master -> master

查看是否迁移成功:

image.png

相关文章

  • 从SVN迁移到GitLab

    之前公司代码版本管理用的都是 SVN ,最近搭了 GitLab 。所以想把代码从 SVN 迁移到 GitLab 上...

  • svn迁移到gitlab

    yum install -y git-svn 如果想保留提交记录,可以用下面的命令找到: 修改格式: 从svn上...

  • svn迁移到gitlab

    1.先建立SVN账号与gitlab账号直接的对应文档users.txt,并放入本地仓库的文件夹中 schacon ...

  • svn迁移到gitlab

    https://blog.csdn.net/u010039418/article/details/86138101...

  • 如何把SVN迁移到Gitlab

    把SVN上的代码仓库迁移到Gitlab上,实际上就是把SVN仓库转变成Git仓库,并且希望能保留原SVN仓库的Co...

  • 如何把SVN迁移到Gitlab

    趁着之前做了有关SVN 迁移到 gitlab的相关经验,也参考了其他人的经验。现在总结一下: 把SVN上的代码仓库...

  • git仓库迁移

    首次发表在个人博客 需求背景: 需要将原来放置gitlab的仓库迁移到新的gitlab,需要将所有分支和tag都迁...

  • SVN迁移Git

    前缘 SVN与Git,哪个最牛逼?现在要将之前的在SVN管理的项目迁移到Gitlab上,简单记录一下简单粗暴的方法...

  • Git切换分支减少重复编译

    在今年的时候,项目从 SVN 转移到 gitlab进行 git托管。前期没有特别的注意,后来越来越明显。 随着后面...

  • gitlab 新建项目 git 命令 学习

    新项目迁移gitlab,学一波git ^ ^ GitHub && Gitlab && SVN 比较 SVN和Git...

网友评论

      本文标题:svn迁移到gitlab

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