TortoiseSVN学习笔记.docx

上传人:b****7 文档编号:23348287 上传时间:2023-05-16 格式:DOCX 页数:11 大小:561.29KB
下载 相关 举报
TortoiseSVN学习笔记.docx_第1页
第1页 / 共11页
TortoiseSVN学习笔记.docx_第2页
第2页 / 共11页
TortoiseSVN学习笔记.docx_第3页
第3页 / 共11页
TortoiseSVN学习笔记.docx_第4页
第4页 / 共11页
TortoiseSVN学习笔记.docx_第5页
第5页 / 共11页
点击查看更多>>
下载资源
资源描述

TortoiseSVN学习笔记.docx

《TortoiseSVN学习笔记.docx》由会员分享,可在线阅读,更多相关《TortoiseSVN学习笔记.docx(11页珍藏版)》请在冰豆网上搜索。

TortoiseSVN学习笔记.docx

TortoiseSVN学习笔记

一,WhatisVersionControl

VersionContorlallowsyoutorecoverolderversionsofyourfilesandexaminethehistoryofhowandwhenyourdatachanged,andwhochangedit.ThisiswhymanypeoplethinkofSubversionandversioncontrolsystemsingeneralasasortof“timemachine”.

二,TortoiseSVN'sFeatures

Shellintegration:

TortoiseSVNintegratesseamlesslyintotheWindowsshell(i.e.theexplorer)

Iconoverlays:

GraphicalUserInterface

EasyaccesstoSubversioncommands

Directoryversioning

Atomiccommits

Versionedmetadata

Choiceofnetworklayers

Consistentdatahandling

Efficientbranchingandtagging

三,License

TortoiseSVNisanOpenSourceprojectdevelopedundertheGNUGeneralPublicLicense(GPL).Itisfreetodownloadandfreetouse,eitherpersonallyorcommercially,onanynumberofPCs.

Althoughmostpeoplejustdownloadtheinstaller,youalsohavefullreadaccesstothesourcecodeofthisprogram.Youcanbrowseitonthislink.Thecurrentdevelopmentlineislocatedunder/trunk/,andthereleasedversionsarelocatedunder/tags/.

四,InstallingTornoiseSVN

4.1Systemrequirements

Ifyou'reusingWindowsXP,youmusthaveatleasttheservicepack3installed.Itwon'tworkifyouhaven'tinstalledthatSPyet!

Theinstallerfor64-bitWindowsalsoincludesthe32-bitextensionparts.Whichmeansyoudon'tneedtoinstallthe32-bitversionseparatelytogettheTortoiseSVNcontextmenuandoverlaysin32-bitapplications.

4.2Install

YouneedAdministratorprivilegestoinstallTortoiseSVN.

4.3BasicConcepts

TheRepository:

Subversionusesacentraldatabasewhichcontainsallyourversion-controlledfileswiththeircompletehistory.Thisdatabaseisreferredtoastherepository.

WorkingCopy:

Youcanpulldownthelatestversionfromtherepository,workonitlocallywithoutaffectinganyoneelse,thenwhenyouarehappywiththechangesyoumadecommitthembacktotherepository.ASubversionworkingcopy(工作副本)doesnotcontainthehistoryoftheproject,butitdoeskeepacopyofthefilesastheyexistintherepositorybeforeyoustartedmakingchanges.Thismeansthatitiseasytocheckexactlywhatchangesyouhavemade.(工作副本不包含工程的历史,只是已存文件的拷贝。

YoualsoneedtoknowwheretofindTortoiseSVNbecausethereisnotmuchtoseefromtheStartMenu.ThisisbecauseTortoiseSVNisaShellextension,sofirstofall,startWindowsExplorer.RightclickonafolderinExplorerandyoushouldseesomenewentriesinthecontextmenulikethis:

五,GoforaTestDrive

5.1CreatingaRepository

ForarealprojectyouwillhavearepositorysetupsomewheresafeandaSubversionservertocontrolit.

FirstcreateanewemptydirectoryonyourPC.Itcangoanywhere,butinthistutorialwearegoingtocallitD:

\svn_repository,clickonthenewfolderandfromthecontextmenuchooseTortoiseSVN→CreateRepositoryhere...

文件夹变成

WewillalsocreatethedefaultinternalfolderstructurebyclickingtheCreatefolderstructurebutton.

备注:

ThelocalrepositoryfeatureisveryusefulfortestandevaluationbutunlessyouareworkingasasoledeveloperononePCyoushouldalwaysuseaproperSubversionserver.Itistemptinginasmallcompanytoavoidtheworkofsettingupaserverandjustaccessyourrepositoryonanetworkshare.Don'teverdothat.Youwilllosedata.ReadSection 3.1.4,“AccessingaRepositoryonaNetworkShare”tofindoutwhythisisabadidea,andhowtosetupaserver.

5.2ImportingaProject

NavigatetotheE:

\研二学年_下\TortoiseSVN.docxinExplorerandrightclickonit.NowselectTortoiseSVN→Import...whichbringsupadialog

ASubversionrepositoryisreferredtobyURL,whichallowsustospecifyarepositoryanywhereontheInternet.InthiscaseweneedtopointtoourownlocalrepositorywhichhasaURLoffile:

///c:

/svn_repos/trunk,andtowhichweaddourownprojectnameWidget1.Notethatthereare3slashesafterfile:

andthatforwardslashesareusedthroughout.

TheotherimportantfeatureofthisdialogistheImportMessageboxwhichallowsyoutoenteramessagedescribingwhatyouaredoing.Whenyoucometolookthroughyourprojecthistory,thesecommitmessagesareavaluableguidetowhatchangeshavebeenmadeandwhy.Inthiscasewecansaysomethingsimplelike“ImporttheWidget1project”.ClickonOKandthefolderisaddedtoyourrepository.

5.3CheckingoutaWorkingCopy

Nowthatwehaveaprojectinourrepository,weneedtocreateaworkingcopytouseforday-to-daywork.Notethattheactofimportingafolderdoesnotautomaticallyturnthatfolderintoaworkingcopy.TheSubversiontermforcreatingafreshworkingcopyisCheckout.WearegoingtocheckouttheToroiseSVNfolderofourrepositoryintoadevelopmentfolderonthePCcalledD:

\ToroiseSVN_1.Createthatfolder,thenrightclickonitandselectTortoiseSVN→Checkout....EntertheURLtocheckout,inthiscasefile:

///c:

/svn_repos/trunk/ToroiseSVN.docxandclickonOK.Ourdevelopmentfolderisthenpopulatedwithfilesfromtherepository.

Youwillnoticethattheappearanceofthisfolderisdifferentfromouroriginalfolder.Everyfilehasagreencheckmarkinthebottomleftcorner.TheseareTortoiseSVN'sstatusiconswhichareonlypresentinaworkingcopy.Thegreenstateindicatesthatthefileisunchangedfromtheversionintherepository.

5.4MakingChanges

Timetogettowork.IntheTortoiseSVN_1westarteditingfiles-let'ssaywemakechangestoTortoiseSVN.docx.Noticethattheiconoverlaysonthesefileshavenowchangedtored,indicatingthatchangeshavebeenmadelocally.

Butwhatarethechanges?

RightclickononeofthechangedfilesandselectTortoiseSVN→Diff.TortoiseSVN'sfilecomparetoolstarts,showingyouexactlywhichlineshavechanged.

如下图所示:

显示了原文档与Checkout出来又修改过的文档的对比结果,左边蓝色字体显示的是与原文档不一样的地方,即新添加的结果。

OK,sowearehappywiththechanges,let'supdatetherepository.ThisactionisreferredtoasaCommitofthechanges.RightclickontheTortoiseSVN_1folderandselectTortoiseSVN→Commit.Thecommitdialogliststhechangedfiles,eachwithacheckbox.Youmightwanttochooseonlyasubsetofthosefiles.EnterupamessagetodescribewhatthechangeisallaboutandclickonOK.Theprogressdialogshowsthefilesbeinguploadedtotherepositoryandyou'redone.

显示提交成功,版本号改变

5.5AddingMoreFiles

RightclickonthefolderandTortoiseSVN→Add.TheAdddialognowshowsyouallunversionedfilesandyoucanselectwhichonesyouwanttoadd.AnotherwayofaddingfileswouldbetorightclickonthefileitselfandselectTortoiseSVN→Add.

Nowwhenyougotocommitthefolder,thenewfileshowsupasAddedandtheexistingfileasModified.Notethatyoucandoubleclickonthemodifiedfiletocheckexactlywhatchangesweremade.

在TortoiseSVN_1下添加两个文件,并把这两个文件添加到版本控制里面去。

首先,

然后,

选中要添加版本控制的文件

显示添加成功

5.6ViewingtheProjectHistory

OneofthemostusefulfeaturesofTortoiseSVNistheLogdialog.Thisshowsyoualistofallthecommitsyoumadetoafileorfolder,andshowsthosedetailedcommitmessagesthatyouentered;-)

5.7UndoingChanges

Onefeatureofallrevisioncontrolsystemsisthattheyletyouundo(取消)changesthatyoumadepreviously.Asyouwouldexpect,TortoiseSVNmakesthiseasytoaccess.

Ifyouwanttogetridofchangesthatyouhavenotyetcommittedandresetyourfiletothewayitwasbeforeyoustartedediting,TortoiseSVN→Revertisyourfriend.Thisdiscardsyourchanges(totheRecyclebin,justincase)andrevertstothecommittedversionyoustartedwith.Ifyouwanttogetridofjustsomeofthechanges,youcanuseTortoiseMergetoviewthedifferencesandselectivelyrevertchangedlines.

Ifyouwanttoundotheeffectsofaparticularrevision,startwiththeLogdialogandfindtheoffendingrevision.SelectContextMenu→Revertchangesfromthisrevisionandthosechangeswillbeundone。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 自然科学 > 生物学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1