遷移簡(jiǎn)介
應(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不會(huì)推送標(biāo)簽(tag),除非使用-tags選項(xiàng)。)
- 至此,完成了wxxr-core-framework的遷移。下一步執(zhí)行比較驗(yàn)證。
Git 時(shí)不時(shí)地將這些對(duì)象打包至一個(gè)叫 packfile 的二進(jìn)制文件以節(jié)省空間并提高效率。當(dāng)倉庫中有太多的松散對(duì)象,或是手工調(diào)用git gc 命令,或推送至遠(yuǎn)程服務(wù)器時(shí),Git 都會(huì)這樣做。
附:遷移腳本
遷移驗(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);
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo (generate-help-mojo) on project wxxr-build-maven-plugin: Execution generate-help-mojo of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo failed: 48188 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo (generate-help-mojo) on project wxxr-build-maven-plugin: Execution generate-help-mojo of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo failed: 48188
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution generate-help-mojo of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:helpmojo failed: 48188
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 48188
at org.objectweb.asm.ClassReader.readClass(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.apache.maven.tools.plugin.annotations.scanner.DefaultMojoAnnotationsScanner.scanFile(DefaultMojoAnnotationsScanner.java:139)
at org.apache.maven.tools.plugin.annotations.scanner.DefaultMojoAnnotationsScanner.scan(DefaultMojoAnnotationsScanner.java:85)
at org.apache.maven.tools.plugin.annotations.JavaAnnotationsMojoDescriptorExtractor.scanAnnotations(JavaAnnotationsMojoDescriptorExtractor.java:125)
at org.apache.maven.tools.plugin.annotations.JavaAnnotationsMojoDescriptorExtractor.execute(JavaAnnotationsMojoDescriptorExtractor.java:104)
at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:108)
at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:233)
at org.apache.maven.plugin.plugin.HelpGeneratorMojo.execute(HelpGeneratorMojo.java:88)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
... 20 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
臨時(shí)解決辦法:將commons-jelly 版本由1.0改為1.0-RC1
<dependency>
<groupId>commons-jelly</groupId>
<artifactId>commons-jelly</artifactId>
<version>1.0-RC1</version>
</dependency>
Daniel
Mohl是一名專業(yè)的軟件工程師/架構(gòu)師,他的興趣包括理解各種復(fù)雜的編程語言、企業(yè)應(yīng)用架構(gòu)以及如何搭建業(yè)務(wù)與技術(shù),他通曉F#、C#、
CoffeeScript、JavaScript、Erlang、ASP.NET、MVC、WPF、WCF、Sliverlight、SQL
Server等技術(shù)。有著多年的軟件開發(fā)經(jīng)驗(yàn)。
他經(jīng)常會(huì)被一些有潛力和有前途的程序員問到:“我要怎么做才能成為一名架構(gòu)師?”說實(shí)話,這已經(jīng)是老生常談的話題了,答案當(dāng)然是視情況而定。不過他也根據(jù)自己的經(jīng)驗(yàn),給大家一些建議,并且提供一些資料,助你快速走上架構(gòu)師這條道路。
下面是Daniel Mohl所提出的列表,供大家參考:
首先,你必須不斷地尋求改善和提升自己。而提升自己的最好方法是閱讀,下面有幾本書,對(duì)我的軟件架構(gòu)技能的提升很大。推薦給大家:
除了閱讀,還有沒有其他需要注意的、或者在平時(shí)需要關(guān)注的東西呢?
- 每隔一兩年學(xué)習(xí)一門新語言,F(xiàn)#是個(gè)不錯(cuò)的選擇。
- 選擇一個(gè)重點(diǎn)領(lǐng)域,但是盡可能對(duì)許多技術(shù)有個(gè)高層次的理解
- 對(duì)你所關(guān)注的重點(diǎn)領(lǐng)域,開通一個(gè)博客并且繼續(xù)拓展該領(lǐng)域的知識(shí)面,讓自己漸漸成為一名專家。
- 與不同的技術(shù)、編程語言、設(shè)計(jì)模式和結(jié)構(gòu)等(甚至是它并沒有在日常中給予你直接的幫助)打交道。你永遠(yuǎn)都不知道這些知識(shí)是否會(huì)在未來派上用場(chǎng),但是對(duì)你絕對(duì)是有益無害。
- 根據(jù)你的目標(biāo)受眾來談?wù)?#8220;語言”。作為一名架構(gòu)師,你將會(huì)與各種各樣等級(jí)的人打交道,并且他們對(duì)技術(shù)的理解也會(huì)有所不同。所以要學(xué)會(huì)調(diào)整你的講解方式,做到因人制宜,讓他們能夠理解。
- 閱讀博客、觀看/參加Twitter或G+、聽播客、讀雜志、參加用戶小組會(huì)議和技術(shù)會(huì)議,并且在這些會(huì)議上踴躍發(fā)言。這些都會(huì)給你帶來無窮無盡的知識(shí)和樂趣,建立自己的“品牌”和提供交流機(jī)會(huì)。
- 紀(jì)律是關(guān)鍵。永遠(yuǎn)做你自己最喜歡的工作,即使它聽起來不那么有趣。每天安排時(shí)間學(xué)習(xí)一些新的東西,即使是15分鐘也可,千萬不要被其他事情占用了這段時(shí)間。
- 開啟博客之旅。我發(fā)現(xiàn),與閱讀比起來,把東西寫下來會(huì)讓你有更深入的理解。
- 利用好“閑暇時(shí)間”,這段時(shí)間可以拿本雜志讀讀,或者去聽聽播客等。
- 了解各種可用的開發(fā)工具,可以使架構(gòu)師的工作更好、更有效
- 看許多不同項(xiàng)目里的架構(gòu)
- 學(xué)習(xí)各個(gè)項(xiàng)目的管理方法
- 學(xué)習(xí)一些評(píng)估技術(shù),對(duì)業(yè)務(wù)可以提供有價(jià)值的評(píng)估
上面是作者總結(jié)出來的列表,雖然看起來有點(diǎn)枯燥無味,但在整個(gè)軟件開發(fā)過程中是樂趣無窮的。如果你還有更好的建議,歡迎與我們分享。
來自:How to Become a Software Architect