svn遷移到gitlab

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
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • Spring Cloud為開發人員提供了快速構建分布式系統中一些常見模式的工具(例如配置管理,服務發現,斷路器,智...
    卡卡羅2017閱讀 134,991評論 19 139
  • 源代碼管理工具的起源 為什么會出現源代碼管理工具? 為了解決在軟件開發過程中,由源代碼引發的各種蛋疼繁瑣問題 源代...
    小白文_Vincent閱讀 3,220評論 2 8
  • 總去猜疑這什么 忘卻了自己的實體 這樣很自卑 你早晚要放下 好好睡覺吧
    待解救的傻子閱讀 169評論 0 0
  • 0 飛機起飛時,仁川已經入夜了。 閔玧其透過窗,看到在這個會飛的小箱子底下,路燈和霓虹黏在一起,黏成華夫餅的網格,...
    802cc71a0ccf閱讀 246評論 0 0
  • 原文摘錄: 如果你總是為了工作而熬夜或者犧牲周末時光,其實并不是因為你有很多工作要做,而是因為你的工作狀態不佳。而...
    嗑瓜子的曉鳴閱讀 420評論 0 0