= SVN quick reference Last edition on '''[[Wikinfo(changed_ts)]]''' by '''[[Wikinfo(changed_by)]]''' __For reference, browse to__ http://svnbook.red-bean.com {{{#!box width=60em {{{#!sh ## Definitions ${REV} ## REVision number ${WCPATH} ## Working Copy PATH ${URL} ## URL of working path mirrored (repository URL + relative path) ## Repository URL depends on your role ## - user => http://forge.ipsl.jussieu.fr/nemo/svn ## - developer => svn+ssh://${ID}@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn }}} }}} {{{#!th == Basic use }}} {{{#!th == Advanced features }}} |- {{{#!td == Working copy {{{#!sh ## Download a working copy svn {checkout,co} ${URL}[@${REV}] ## Update it svn {up,update} [-r ${REV}] [${WCPATH}] ## Push modifications svn {ci,commit} [-m 'one-liner message'] [${WCPATH}] svn {ci,commit} --include-externals ... ## Append externals }}} == Items {{{#!sh ## Common cmds svn add ${WCPATH} ## Add item under versioning svn {delete,remove,rm} ${WCPATH} ## Remove item svn {st,status} [${WCPATH}] ## List modified items svn diff [${WCPATH}] ## Differences inside items svn revert ${WCPATH} ## Give up edits ## Straightforward UNIX-like cmds svn {cat,list,ls} {${URL},${WCPATH}}[@${REV}] svn mkdir {${URL},${WCPATH}} ## Apply edits from diff file svn patch ${DIFF} [${WCPATH}] ## SVN version > 1.7 ## Infos svn log {${URL},${WCPATH}}[@${REV}] ## List commit messages svn info {${URL},${WCPATH}}[@${REV}] ## Metadata of working copy ## In case of trouble svn {resolve,resolved} ${WCPATH} ## Ruling conflicted files svn cleanup [${WCPATH}] ## Fix corrupted working copy }}} == Old working version with outdated externals {{{#!sh ## Download a working copy svn {checkout,co} ${URL}[@${REV}] ## Change external source version svn {propedit,pedit} --editor-cmd vi svn:externals ${WCPATH} ## Replace @HEAD by @${REV} ## Update svn update -r ${REV} ${WCPATH} }}} }}} {{{#!td == Properties http://svnbook.red-bean.com/en/1.7/svn.ref.properties.html {{{#!sh ## Sub-cmds for managing properties ## {propdel,pdel} / {propset,pset} ## {propedit,pedit} / {proplist,plist} ## list svn properties svn proplist ${WCPATH} ## print content of a specific svn properties, for example svn:externals svn propget svn:externals ${WCPATH} ## 'svn:keywords Id': record commit infos in routine svn {propset,pset} svn:keywords Id ${WCPATH} ## 'svn:executable': set permissions for running scripts svn {propset,pset} svn:executable ${WCPATH} ## 'svn:externals': defining external sources for items ## - Single external svn {propset,pset} svn:externals ${URL}[@${REV}] ${WCPATH} ## - Multi externals (for example edit with vi) svn {propedit,pedit} --editor-cmd vi svn:externals ${WCPATH} ## commit only svn properties svn ci --depth empty -m "blablabla" ${WCPATH} }}} == Branching {{{#!sh ## Create a branch (copying) svn copy {${URL},${WCPATH}}[@${REV}] {${URL},${WCPATH}} ## Merging sources svn merge {${URL1},${WCPATH1}}[@${REV1}] \ [{${URL1},${WCPATH2}}[@${REV2}]] \ ([${WCPATH}] ## Update to a new URL ## - Mirror a traversing branch (hazardous!!) svn switch ${URL}[@${REV}] [${WCPATH}] ## - Relocate to a new server or different URL scheme svn switch --relocate ${URL1} ${URL2} ## SVN version < 1.7 svn relocate ${URL1} ${URL2} ## SVN version > 1.7 }}} }}}