遷移簡介
應用工具:cvs2git
工作原理:文件系統的copy, from cvs repository to export temp file, then import to Git repository.
使用條件: Git version 1.5.4.4 or later (我們的目標 git 庫版本:
git --version
git version 1.9.0
git --version
git version 1.9.0
cvs2git工具安裝
遷移過程
具體的遷移過程:
以下為遷移wxxr-core-framework
1. 在123.1上用cvs2git把cvs倉庫,導出成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
- 創建本地git倉庫
- git init --bare wxxr-core-framework.git
- 下載導出的git的備份文件到本地臨時目錄 **
- cd /Users/zhangjq/temp/cvs2git
- scp -r djboss@192.168.123.1:/tmp/cvs2git/output/git-* .
- 用git的fast-import命令把從cvs導出的git備份文件導入剛創建的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 上創建遠程倉庫** 創建了framework-core 倉庫集,并在此倉庫集下創建了wxxr-core-framework, wxxr-core-web 等遠程倉庫**http://developer.corp.wxxr.com.cn/git/projects/FRMCORE/repos/wxxr-core-framework/browse
- 在本地執行** git branch -D TAG.FIXUP (執行git branch -a 沒有找到這個分支,為什么刪除?error: branch 'TAG.FIXUP' not found. )
-
- git push --all origin (將本地的所有分支都推送到遠程主機)
- git push -
tags origin (最后,git push不會推送標簽(tag),除非使用-tags選項。)
- 至此,完成了wxxr-core-framework的遷移。下一步執行比較驗證。
Git 時不時地將這些對象打包至一個叫 packfile 的二進制文件以節省空間并提高效率。當倉庫中有太多的松散對象,或是手工調用git gc 命令,或推送至遠程服務器時,Git 都會這樣做。
附:遷移腳本
遷移驗證
用本地cvs代碼庫代碼與git下載的庫代碼比較,有$Revision$ 的少版本信息外,其它一切正常。
遷移報告
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);
方向:分布式系統設計