遷移簡介
應(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 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
fast-import wxxr-core-framework source code:
:)
@import url(http://www.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
方向:分布式系統(tǒng)設(shè)計(jì)