svn項目導入到gitlab

環境介紹git

svn和gitlab都是rpm包安裝的vim


svn版本 1.7.4 (r1295709)服務器

gitlab版本 8.8.5-cessh


git-svn用於Git和SVN的轉換,能夠把Git倉庫遷移成SVN倉庫,反之亦可ide


在一臺空閒的服務器上面安裝git-svnsvn

yum install -y git-svngitlab


建立一個空目錄spa

mkdir /opt/gitrem

cd /opt/gitit


建立svn用戶和git用戶對應表

vim userinfo.txt

格式以下

svn用戶=git用戶<郵箱地址>

列如

xx=xx<xiaohu@baidu.com>


導出 svn 工程

git svn clone svn://192.168.1.81/project_xx --authors-file=userinfo.txt


若是出現

Author: lq not defined in userinfo.txt file

那就在userinfo.txt裏面添加一個lq用戶

刪除project_xx 目錄,從新執行git svn clone命令


上傳到 git 服務器

cd project_xx

git remote add origin ssh://git@gitlab.baidu.com:2020/PHP/project_xx.git

用git push命令推送所有的分支和標籤信息到git服務器上面

git push origin master --tags


登陸到gitlab,查看更改記錄是否存在

相關文章
相關標籤/搜索