Anda di halaman 1dari 5

12/2/13 How To Set Up An SVN Repository In 7 Simple Steps | aj | CivicActions

www.civicactions.com/blog/2010/may/25/how_set_svn_repository_7_simple_steps 1/5

Submittedby
A.J.Roach
onMay25,2010
HowToSetUpAnSVNRepository
In7SimpleSteps
inDevelopment, Freedom, SvnClient, SvnRepository, SvnServer |11
comments
Forsometimenow,I'vewantedtohaveansvnsetuponmysharedwebhost
similartowhatwehavehereatcivicactions.Havingtomakechangesonmy
localmachineforanypersonal(noncivicactionsclient)sites,thenscpthosefiles
uptomyserverisridiculousespeciallysincewhenworkingonclientsites,I've
becomesousedtosimplycommitingthechangestoarepositoryandthen
updatingthatrepositoryontheserverside.Allthatsaidthough,Ikeptputting
offthesvnsetupbecauseasasimpledrupalandcivicrmdeveloper,Iwasafraid
thatasystemadmintasklikesettingupsvnwouldbetooinvolvedandmaybea
bitovermyhead.Turnsout,Ishould'vedoneitmonthsago.It'scrazyeasy!
Step1
Makesurethatsvnisinstalledonyourwebhost.Justsshintoyouraccountand
type
which svn
Luckyforme,mysharedhostalreadyhadsvninstalledat/usr/bin/svn.Ifyou're
notsolucky,thenyou'llneedtoinstallsvnyourself.Dependingonyoursystem
andyoursetup,therearemultiplewaystodothis.Forthisandallothersvn
questions,I'drecommendthesvnredbook.Oneofthefinestexamplesofopen
sourcesoftwaredocumentationI'veeverseen.Extremelyhelpful.Ofcourse,
ifyou'reonasharedhostlikeme,thenyouprobablywon'thavetheaccessyou
needinordertoinstallsvn.Inthatcase,contactyoursystemadministratorand
askthemtoinstallsvnforyou.
Step2
Createyourrepository.Oncesvnisinstalledonyourhost,youcanproceed
withtherepositorysetup.Justsshintoyourserverandcreatearepository
whereveryou'dlikeit.InmycaseIputmyrepositoryinmyuserdirectory.I
would'vepreferredtohaveitintherootdirectory,butbecauseit'sashared
host,Idon'thavewriteaccesstoanythingoutsideofmyuserdirectory.To
createtherepository,issuethefollowingcommand:
svnadmin create ~/myrepository
Step3
CreateyourSVNuser:Nowthatyourrepositoryissuccessfullysetup,you'll
needtocreateansvnuser.Simplyopenthesvnserve.conffileintheeditorof
Search
Home Portfolio OurTeam Blog About Services Employment
FreeDownload
TheAgile
Nonprofit
AQuickStartGuide
toIterative
WebDevelopment
DownloadNow
UpcomingEvents
Therearenoeventstonote,hopefully
soon.
StayConnected
SIGNUPFOROURFREE
EMAILNEWSLETTER
SUBSCRIBETOOUR
BLOGRSSFEED
SUBSCRIBETOOUR
BLOGEMAILUPDATES
FOLLOWUS
@CIVICACTIONS
FOLLOWOUR
TEAMMEMBERS
CONNECTWITHUS
ONLINKEDIN
12/2/13 How To Set Up An SVN Repository In 7 Simple Steps | aj | CivicActions
www.civicactions.com/blog/2010/may/25/how_set_svn_repository_7_simple_steps 2/5
yourchoice:
pico ~/myrepository/conf/svnserve.conf
andaddthefollowing:
anon-access = none
auth-access = write
password-db = passwd
Nowyou'llneedtocreateapasswordfile:
pico ~/myrepository/conf/passwd
Addalineinthatfileforyouruserintheformat=
exampleuser = examplepassword
Step4
Createahierarchyforyourrepository:Thisstepisoptional.It'snotneededin
ordertogetsvntoworkproperly,butifyou'replanningonkeepingmultiple
projectsunderrevisioncontrol,thenit'sagoodideatogetorganizedbeforeyou
startimportingthoseprojects.Inmycase,I'llbeworkingonupgradingoneof
mysitesfromDrupal5toDrupal6soon(yes,Iknow...I'vebeenputtingthat
offtoo.),soIwantedatrunkfortheDrupal5projectandatrunkforthesoon
tobeupgradedDrupal6project.Youcancreatedirectoriesinyourrepository
inalmostthesamewayyoucreatethemonyourfilesystem,usingmkdir.You'll
needtousesvn'smkdircommandthoughlikeso:NOTE:Relativepaths
don'tseemtoworkhere.svndoesn'tseemtolike'~',sorememberto
startwiththerootdirectory(soit'lllooklike'file:///root/rest/of/path...'.
Withthreeforwardslashes.
svn mkdir file:///path to your repository/myrepository/d5
svn mkdir file:///path to your repository/myrepository/d6
Nowyou'realmostthere.Next,you'llneedtoimportthefilesyouwanttokeep
underversioncontrolintoyournewrepository.Dothatwiththesvnimport
command.
svn import /path to your project/myD5project file:///path
to your repository/myrepository/d5
svn import /path to your project/myD6project file:///path
to your repository/myrepository/d6
Step5
Runthesvnserverasdaemon:
svnserve -d
Step6
Checkoutyourrepositoryontoyourlocalmachine:Backonyourlocal
machine,gotowhereyoukeepyournerdstuff.Inmycaseit'sin~/workspace.
Thenusethesvncocommandtocheckoutacopyofyourproject.
cd ~/workspace
svn co svn+ssh://username@hostname/path to
repository/myrepository/d6
BlogTopics
AgileConferenceDrupal
Drupal6DrupalConGoogleiPhone
MobilePoliticsTechnology
Usabilityvideo
moretags
RecentBlogPosts
TransformingGovernment
TechnologythoughAgile
SoftwareDevelopment
CongratulationsBenKallos
TakingCivicActionSeriously
TheAgileEstateSale
DistributedAgileTeamsA
remindertomakeitgreat
ModuleDevelopmentinDrupal8
BrainstormingandPrioritizingwith
Trello
MeetUsAtDrupalcampThis
WeekendNewYorkCity,
Toronto&LosAngeles
ImprovingourAgilePractice
YouthbuildUSAinthenews
CiviCRMandDrupalCommons
more
UserLogin
LoginusingOpenID:
WhatisOpenID?
Username:*
Password:*
Login
Createnewaccount
Requestnewpassword
12/2/13 How To Set Up An SVN Repository In 7 Simple Steps | aj | CivicActions
www.civicactions.com/blog/2010/may/25/how_set_svn_repository_7_simple_steps 3/5
DonaldHarperAugust
31,2011
Youmightchecktomakesurethatyouhavetheproper
directorieslistedinstep4.I'veseenthaterrorwheni
eitherhadatrailingslash,However,ifIweredoingthis
nowformyownuse,IwouldprobablyuseGitinsteadof
svn.Youshouldkeepcaptcharightbelowthetextarea,I
missedtoseeitorjusthitenterThankyou.
Anonymous(not
verified)August29,2011
dearsiriwanthowtoconfigureforconnectsvnsever
linuxtowindows.
Anonymous(not
verified)July30,2011
Onstep4Igetthefollowingerror:svn:'.'isnota
workingcopy
GregoryHellerAugust
1,2011
Youmightchecktomakesurethatyouhavethe
properdirectorieslistedinstep4.I'veseenthaterror
whenieitherhadatrailingslash,orwasmissinga
periodtoindicatethecurrentdirectory.Youcanalso
try"svncleanup."fromthedirectoryyouarehaving
troublewith.
Anonymous(not
verified)July16,2011
icreatedafolder"d5"withsvnmkdir.theniimportafile
"whatever"intothatfolderusingsvnimportbutiget
error:svn:Path'file:///.........../db5'alreadyexistsbutifi
introduceANOTHER_FOLDERthenitimportsit.svn
mkdir file:///path to your
repository/myrepository/d6svn import /path
to your project/myD5project file:///path
to your
repository/myrepository/d5/ANOTHER_FOLDER
Anonymous(not
verified)July16,2011
icreatedafolder"asdf"withsvnmkdir.theniimporta
file"whatever"intothatfolderusingsvnimportbutiget
errorsvnpathalreadyexists.
vinay(notverified)
svn:Couldnotuseexternaleditortofetchlogmessage
considersettingthe$SVN_EDITORenvironment
Shareit!
Step7
Gogetatastybeverageandrestcomfortablyintheknowledgethatyou'llnever
havetoscpanotherfileagain.Well,exceptformaybetheoccasional
mysqldumpfile...
12/2/13 How To Set Up An SVN Repository In 7 Simple Steps | aj | CivicActions
www.civicactions.com/blog/2010/may/25/how_set_svn_repository_7_simple_steps 4/5
March23,2011 variableorusingthemessage(m)orfile(F)
optionssvn:Noneoftheenvironmentvariables
SVN_EDITOR,VISUALorEDITORisset,andno
'editorcmd'runtimeconfigurationoptionwasfoundcan
anyoneguidemehere?
Rob(notverified)
January25,2011
Notsurewhyyouwouldusesvnserve,muchbetterto
useapachetoserve
svn.http://www.duchnik.com/tutorials/vc/installingand
configuringsvnonce...cheers!
Joe(notverified)
October19,2010
DoyouknowifyouhavetohaveApache2installed,or
willgoodoldApache1.3.42do?
alakenJune9,2010
Ididthisafewyearsago,notonasharedhosting
accountbutonaVPSIhaveatSlicehost.Slicehosthas
anamazingcollectionofwellwrittenarticlesonallkinds
ofsysadminandLAMPtopics.Withtheirarticleson
SubversionIwasabletogetmyrepoupandrunning
easily.
Thatseriesofarticleswillleadyouthroughtheprocess
andgiveyouabitmoredetailaboutsecurity,multiple
repositories,andwhileveryeasytofollow,explainsome
ofthe'why'behindthe'how'.
Herearesomeslidesfromapresentationacolleagueand
IdidonGitandSVNamonthortwoago:Version
ControlwithSVNandGit.
However,ifIweredoingthisnowformyownuse,I
wouldprobablyuseGitinsteadofsvn.
dan(notverified)June6,
2010
Thankyouforwritingthis,Iwasreallylookingforit.So
farIhaveonlyusedonWindowsSVNwithout
commandlinebutmouse,rightclickleftclickto
checkoutorcommitetcandonlyforlocaldevelopment
nevertriedathostingcompanyaccount.
Iwishyouwouldhavecreatedascreenshotbased
version.
Infomaybehelpfultoyou:
a.whenIsearchedyourpagewasintop6ongoogle
b.Ican'tseethisspecificarticle/postatanyotherweb
page
c.Whathostingcompanyyoudidthissvnstuff,mineis
Godaddy
12/2/13 How To Set Up An SVN Repository In 7 Simple Steps | aj | CivicActions
www.civicactions.com/blog/2010/may/25/how_set_svn_repository_7_simple_steps 5/5
Home OurTeam Services Blog About Sitemap
CivicActionsLicensingPolicy
d.Ioftengetthedevelopmentbymyselforindependent
contractorsowanttokeeptrackusingsvntype
tool/process

SUGGESTION:
Youshouldkeepcaptcharightbelowthetextarea,I
missedtoseeitorjusthitenter

Thankyou.

Anda mungkin juga menyukai