zoukankan      html  css  js  c++  java
  • svn、gitlab迁移至另一gitlab系统

    一、svn迁移至gitlab详细步骤

    1.安装软件

    yum  install  -y  perl  git  subversion  -y

    rpm   -ivh   *.rpm

    2.整理svn系统内用户名单user.txt

    (1)方法一:

    svn checkout  http://svnserver/trunk

    cd  ./trunk

    svn log --xml --quiet | grep author |  sort -u | perl pe 's/.*>(.*?)<.*/$1=/' > user.txt

    (2)方法二:

    进入svn根目录,点show log,查看所有提交人信息。并记录入user.txt中。

    两种方式整理出的用户名单格式为:用户账号 = 用户名 <123@qq.com>

    z12562 = zhangsan <kis@qq.com>

    3.开始迁移

    (1)克隆svn仓库至本地

    git  svn  clone  http://192.168.2.173/rjkf_code  --no-metadata  --authors-file=user.txt

    (2)关联远端 gitlab仓库

    cd  rjkf_code

    git  remote  add  origin  http://10.153.2.193/rjkf/test.git

    (3)推送至gitlab服务器master分支

    cd  rjkf_code

    git  push  -u  origin  master

    (4)查看备份脚本和备份时间

    crontab  -l

    二、gitlab迁移至gitlab具体步骤

    1.下载原来gitlab源码

    git  clone  http://gitlab.**.com/projectName      默认克隆远程master分支

    2.查看远程所有分支

    git  branch  -a

    3.创建本地远程分支

    git  checkout  -b  dev   origin/dev     本地分支名为dev,克隆的为远端分支origin/dev

    git  checkout  -b  featureA   origin/featureA        本地分支名为featureA   ,克隆的为远端分支origin/featureA   

    ……

    4.gitlab地址替换为新gitlab地址

    git   remote   set-url  origin   http://gitlab.**.com/newProjectName

    git   remote  -v     查看远程gitlab地址是否关联成功

    5.本地推送至新gitlab地址

    git  push  origin  --all   推送master和所有其它分支

    git   push  --tags    推送所有标签

  • 相关阅读:
    16. 3Sum Closest
    17. Letter Combinations of a Phone Number
    20. Valid Parentheses
    77. Combinations
    80. Remove Duplicates from Sorted Array II
    82. Remove Duplicates from Sorted List II
    88. Merge Sorted Array
    257. Binary Tree Paths
    225. Implement Stack using Queues
    113. Path Sum II
  • 原文地址:https://www.cnblogs.com/schblog/p/13170771.html
Copyright © 2011-2022 走看看