andyj2ee

          java tec sky

          統(tǒng)計(jì)

          留言簿(4)

          activemq

          aop

          design pattern

          other blog

          spring

          workflow

          多線程

          軟件架構(gòu)師

          閱讀排行榜

          評論排行榜

          系統(tǒng)cvs to Git 遷移

          遷移簡介

          應(yīng)用工具:cvs2git

          工作原理:文件系統(tǒng)的copy, from cvs repository to export temp file, then import to Git repository.

          使用條件: Git version 1.5.4.4 or later (我們的目標(biāo) git 庫版本:

          git --version

          git version 1.9.0

          git --version
          git version 1.9.0

          cvs2git工具安裝

          遷移過程

          具體的遷移過程:

          以下為遷移wxxr-core-framework

          1. 在123.1上用cvs2git把cvs倉庫,導(dǎo)出成git的備份文件(blob file and dump file)

          • cvs2git --blobfile=/tmp/cvs2git/output/git-blob-cfw.dat --dumpfile=/tmp/cvs2git/output/git-dump-cfw.dat --username=zhangjunqing --fallback-encoding=GBK /app/cvsroot/wxxr-projects/wxxr-core-framework
          • 創(chuàng)建本地git倉庫 
            • git init --bare wxxr-core-framework.git
          • 下載導(dǎo)出的git的備份文件到本地臨時(shí)目錄 **
            • cd /Users/zhangjq/temp/cvs2git
            • scp -r djboss@192.168.123.1:/tmp/cvs2git/output/git-* . 
          • 用git的fast-import命令把從cvs導(dǎo)出的git備份文件導(dǎo)入剛創(chuàng)建的git倉庫** cd /Users/zhangjq/git/wxxr-core-framework/wxxr-core-framework.git** cat /Users/zhangjq/temp/cvs2git/git-blob-cfw.dat /Users/zhangjq/temp/cvs2git/git-dump-cfw.dat | git fast-import
          • 在Stash 上創(chuàng)建遠(yuǎn)程倉庫** 創(chuàng)建了framework-core 倉庫集,并在此倉庫集下創(chuàng)建了wxxr-core-framework, wxxr-core-web  等遠(yuǎn)程倉庫**http://developer.corp.wxxr.com.cn/git/projects/FRMCORE/repos/wxxr-core-framework/browse
            •  
          • 在本地執(zhí)行** git branch -D TAG.FIXUP (執(zhí)行g(shù)it branch -a 沒有找到這個(gè)分支,為什么刪除?error: branch 'TAG.FIXUP' not found. )
            • git gc --prune=now
            • git push --all origin  (將本地的所有分支都推送到遠(yuǎn)程主機(jī))
            • git push -tags origin (最后,git push不會推送標(biāo)簽(tag),除非使用-tags選項(xiàng)。)
          • 至此,完成了wxxr-core-framework的遷移。下一步執(zhí)行比較驗(yàn)證。

          Git 時(shí)不時(shí)地將這些對象打包至一個(gè)叫 packfile 的二進(jìn)制文件以節(jié)省空間并提高效率。當(dāng)倉庫中有太多的松散對象,或是手工調(diào)用git gc 命令,或推送至遠(yuǎn)程服務(wù)器時(shí),Git 都會這樣做。

          附:遷移腳本

          遷移驗(yàn)證

          用本地cvs代碼庫代碼與git下載的庫代碼比較,有$Revision$ 的少版本信息外,其它一切正常。

          遷移報(bào)告

          wxxr-core-framework

          cvs2svn Statistics:
          ------------------
          Total CVS Files:              3000
          Total CVS Revisions:          9439
          Total CVS Branches:          33449
          Total CVS Tags:            3278944
          Total Unique Tags:            2446
          Total Unique Branches:          24
          CVS Repos Size in KB:       159751
          Total SVN Commits:            5260
          First Revision Date:    Wed May 31 15:56:03 2006
          Last Revision Date:     Sun Jan  4 17:22:23 2015
          ------------------
          Timings (seconds):
          ------------------
          1065   pass1    CollectRevsPass
          0   pass2    CleanMetadataPass
          0   pass3    CollateSymbolsPass
          648   pass4    FilterSymbolsPass
          1   pass5    SortRevisionsPass
          37   pass6    SortSymbolsPass
          436   pass7    InitializeChangesetsPass
          82   pass8    BreakRevisionChangesetCyclesPass
          82   pass9    RevisionTopologicalSortPass
          296   pass10   BreakSymbolChangesetCyclesPass
          406   pass11   BreakAllChangesetCyclesPass
          413   pass12   TopologicalSortPass
          319   pass13   CreateRevsPass
          159   pass14   SortSymbolOpeningsClosingsPass
          15   pass15   IndexSymbolsPass
          432   pass16   OutputPass
          4391   total
          

          fast-import wxxr-core-framework source code:

          git-fast-import statistics:
          ---------------------------------------------------------------------
          Alloc'd objects:      45000
          Total objects:        41365 (      2260 duplicates                  )
          blobs  :         7817 (       709 duplicates       6887 deltas of       7248 attempts)
          trees  :        30677 (      1551 duplicates      12608 deltas of      29589 attempts)
          commits:         2871 (         0 duplicates          0 deltas of          0 attempts)
          tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
          Total branches:        2472 (        24 loads     )
          marks:     1073741824 (     11397 unique    )
          atoms:           2772
          Memory total:          4532 KiB
          pools:          2423 KiB
          objects:          2109 KiB
          ---------------------------------------------------------------------
          pack_report: getpagesize()            =       4096
          pack_report: core.packedGitWindowSize = 1073741824
          pack_report: core.packedGitLimit      = 8589934592
          pack_report: pack_used_ctr            =      23737
          pack_report: pack_mmap_calls          =        824
          pack_report: pack_open_windows        =          1 /          1
          pack_report: pack_mapped              =    7439224 /    7439224
          ---------------------------------------------------------------------

          :)

          @import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

          方向:分布式系統(tǒng)設(shè)計(jì)

          posted on 2015-01-13 18:53 java光環(huán) 閱讀(738) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 文山县| 峨眉山市| 乐亭县| 盘山县| 青海省| 大足县| 铜陵市| 陆良县| 靖安县| 尤溪县| 宁陕县| 镇江市| 绵阳市| 安龙县| 定州市| 青浦区| 天长市| 蒙山县| 嵩明县| 秦安县| 云梦县| 监利县| 方山县| 赣州市| 广安市| 大石桥市| 炎陵县| 新津县| 广饶县| 凤翔县| 韶山市| 鸡西市| 横山县| 交口县| 利津县| 深圳市| 万全县| 平阴县| 兴海县| 玛纳斯县| 项城市|