培训SVN分支合并tag
、SVN培训-重点分支、合并、tagVisualSVN ServerTortoiseSVNCornerStoneSVN 术语,Clearcase (UCM & Base)术语* repository vob存储库酉己置库* trunk base mainline integration-stream主干 主线 集成流* branch development-stream 分支 开发流* tag baseline lable snapshot 标签 基线 快照* workcopy view 工作副本 视图 本地工作空间意义是人赋予的1 / 262. SVN 工作方式R三106R三100/© Submit yom| svn comrn:svii upda.1get contentsvn chec kcaitsvn upda_teUpdate yousvn addsvn move svn deleteMake changesMenSV® See what was changedin the repository in the meantimesvii status -uSubversionRepositoryR三105SallyHarry SallyRepositorySallyHarryCommit Failed!ActonPathComma ndCommitModifiedF: l ITestZyProject 1.0 Readme. txtErrorCommit failed (details follow):ErrorFile 'F! lTest24'/Projactl. OVeadrire.ErrorFile '/b日仃ches/M/Project. 0/readmeErrorYou have to update your vorking 匚upCompleted!The operation failed.二、Branch &MergingThe next point to note is that merging always takes place within a working copy. If youwant to merge changes into a branch, you have to have a working copy for that branchchecked out, and invoke the merge wizard from that working copy using TortoiseSVNMergeSVN 可以为一个版本库中的内容(主干)建立一个分支.分支和主干完全独立,就相当于把代码再复制一份,重新添加到版本库中。但SVN提供另一个功能,就是把主干做出的修改合 并到分支中,以及把分支修改的内容合并到主干中。示例:基于 TortoiseSVN1. 建一个分支.StExsampl.calcRelease lock伊除nuh/切| trunkSwitch.涛 Create 阴 t chB; Apply gatch.宅 Settings ?旦邮 译 Aboutganize In clu>J . Projects.branch.tFUH l> . Pyth on25卜 .symc:ache> tmp卜i, Us亡r5Cl CatafystfT Control 匚EntwrExpandShare with也 WinMergeProperties旦 r epWin.Open in new windowAdd to archive.SVN Commit.SVN Show JogSVNDelete昭 TortoiseSVNExport.Relocate.匚 cirriSVIM UpdateSVN Revert,.Delete and add to ignore s© Copy (Branch / Tag)Io URL 1RepositoryFrom WC at URL:https:/Create copy in the repository froni:HEAD revisio仃 in the repository « Specific revision in repository、 Working copy3)"匪 ceni: messages蕖環翌趕=i¥-=al=七r a null型罷西韋工注支H Create intermediate folders_ Switdi working copy to new branc±i/tag建立时要注意:1.当前复制源,即专业术语中的"主干(truck)"2分支存放的位置.当然,分支也是在SVN版本库中.3. 写上日志.这个大家应该懂的.4. 如果目录路径不存在,勾选“Create intermediate folders”,否则确认后会报错。Switch选项建议为空。switch含义:是否把主干的路径切换到分支.如果勾选了,建立分支 后,在主干里做出的修改并提交后,更新会提交到分支上。主干的版本源内容不会变。这时我们看一下 trunk 目录的属性,可以看到它的路径已经变成:/calc/branches/my-calc-branch 了。 j. 匚omputer > Local Disk(匚: Projects. sample > calc trunkOrganize IncLude in library 亍Share with New folderProgram Filet (a86 Projects .sample |A calcbranch 亡 e.paintbranchestrunk口 丄匚di匚tl旦trunk Prop已rti己士 |SecurityGeneralURL; /Revision / Author:Last commit revision;Test Status:Pnewus Versionsnormal|Q Subtfereione calc/bra nche s/rny-c al c-bra nchj匚 ustomizeSharingsvn/sampl'Will. Huang11 ;(B;34 PM,Thursday, January 29l 2(为了避免产生困惑。以及失误。在建立的时候不要勾上 "切换到分支" 的选项。如果勾上了我们还是切换回去:J匚 omplanize IncLud> i.£Program Files Progratn Files Projects.sample>b-ranchc.trunkJ paintExpand供 EkrKh/坦£repWin.0 pen in new windowAdd taarchivE.宠 Switch.Scan with Microsoft SecLrrty Essentials.Share withSt&<5VN Update5VN Commit.Merge.Export.Relocate.Add.Delete and add to ignbianche trunk> .Python25> symcacheSVN Show logSVN DeleteC reate patch,.Apply gatch.Prop 亡 rti 亡 5SVN Reve±.化 TortoiseiVIMgettingHelpAt outQ URLQ3Switch To Brarch i TagH https:/f呂 vnfsample/calcytrun kjRevisionShow oge HEAD reuisianRevisionSwitch:IC: Vrojectsamp le ca IctrunkJrOKCancelHelpY > .注意:1. 主干的目录2. 版本库源路径这时你便可以在 /calc/branches/my-calc-branch 分支上开发新的功能,且不会影响到其他成 员开发或维护主干的内容。其他方向建分支:在 Repo-Browser 中:1. Ctrl+拖拽的方式;2. Copy to3. ShowLog 中选择任意 Reversion,右击->Branch/Tag2. 合并主干的变更也许过了一段时间,原本的/calc/trunk主干可能已经有其他成员陆续修正了一些Bugs,但 这时你的分支 /calc/branches/my-calc-branch 就可以直接套用主干 ( /calc/trunk ) 的更新,除 了避免重复的工作外,也可以避免版本的冲突,因为多人改同样的文件可能发生冲突。经常將开发主干(/calc/trunk )的变更透过svn merge合并至分支(/calc/branches/my-calc-branch )是一个非常好的习惯,这样才不会让你脱离主干(trunk)过 久而导致将分支 ( /calc/branches/my-calc-branch ) 合并回主干 ( /calc/trunk ) 时发生许多冲 突。Clean up卜 Ccunputer Locdl Disk (匚;卜 Projects 卜 sample calc bran ch eanize Include in library/ ProjectsJ ca in pieJ calcJ branches-Cats lystfTM)匚 cmtel CenterEMpa.ndGet lock.Release lockBranch/tg.Switch.my-calc-branchtrunkUTPServicel> WILogResuhtEtrunk卜,Python25 sym cache> tmp卜.Users3