= SVN quick reference Last edition on '''[[Wikinfo(changed_ts)]]''' by '''[[Wikinfo(changed_by)]]''' __For reference, browse to__ http://svnbook.red-bean.com {{{#!sh ## Definitions ${REV} # REVision number ${URL} # web address of a path in the SVN repository (repository URL + relative path in the repository) ## 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 ${WCPATH} # Working Copy PATH }}} {{{#!th == Basic use }}} {{{#!th == Properties }}} {{{#!th == Branching / Merging }}} |- {{{#!td Download a working copy {{{#!sh $ svn {checkout,co} [${WCPATH}] }}} !Add/Remove item (file or folder) {{{#!sh $ svn {add,del,rm} ${WCPATH} }}} Informations on working copy {{{#!sh $ svn info [{${WCPATH},${URL}}][@${REV}] }}} Local status wrt the repository {{{#!sh $ svn status [-[qu]] [${WCPATH}] }}} Local changes {{{#!sh $ svn {diff,revert} ${WCPATH} }}} Push modififcations to repository {{{#!sh $ svn {ci,commit} [-m 'one-liner message'] [${WCPATH}] }}} For modified externals, add `--include-externals` option List commit messages {{{#!sh $ svn log [{${URL},${WCPATH}}[@${REV}]] }}} }}} {{{#!td `svn:keywords Id`: record commit infos in routine {{{#!sh $ svn propset svn:keywords Id on ${WCPATH} }}} `svn:mime-type`: syntax highlighting and merging process {{{#!sh $ svn propset svn:mime-type ... ${WCPATH} }}} `svn:executable`: set permissions for scripts {{{#!sh $ svn propset svn:executable on ${WCPATH} }}} `svn:externals`: defining external sources - Single external {{{#!sh $ svn propset svn:externals ${URL}[@${REV}] ${WCPATH} }}} - Multi externals {{{#!sh $ svn propedit svn:externals ${WCPATH} }}} }}} {{{#!td Create a branch (copying) {{{#!sh $ svn copy {${URL},${WCPATH}}[@${REV}] {${URL},${WCPATH}} }}} Update WC to a new URL - Mirror a different branch $i.e$ traversing branch in the same repository (__hazardous!! __) {{{#!sh $ svn switch ${URL}[@${REV}] [${WCPATH}] }}} - Relocate to a different URL $i.e$ keep the same branch but move to a new server or URL scheme {{{#!sh $ svn switch --relocate ${URL1} ${URL2} }}} Merging sources {{{#!sh $ svn merge {${URL1},${WCPATH1}}[@${REV1}] [{${URL1},${WCPATH2}}[@${REV2}]] [${WCPATH}] }}} Remove a branch {{{#!sh $ svn rm {${URL},${WCPATH}} }}} }}}