= SubVersioN basics Last edition on '''[[Wikinfo(changed_ts)]]''' by '''[[Wikinfo(changed_by)]]''' [[PageOutline(2-3)]] __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 }}} == Versioning {{{#!th !Add/Remove item \\ (file or folder) }}} {{{#!td {{{#!sh $ svn {add,del} ${WCPATH} }}} }}} |- {{{#!th Working copy }}} {{{#!td Display information about a local or remote item {{{#!sh $ svn info [{${WCPATH},${URL}}][@${REV}] }}} Display the current state of the working path wrt the one mirrored in the repository {{{#!sh $ svn status [-[qu]] [${WCPATH}] }}} Display all commits performed to your working path since its creation {{{#!sh $ svn log --verbose --stop-on-copy [${WCPATH}] }}} }}} |- {{{#!th Revert changes \\ (local) }}} {{{#!td {{{#!sh $ svn revert ${WCPATH} }}} }}} |- {{{#!th Push changes }}} {{{#!td {{{#!sh $ svn ci [-m 'one-liner log message'] [${WCPATH}] }}} For modified externals, add `--include-externals` option }}} == Properties {{{#!th Set properties }}} {{{#!td `svn:keywords Id`: log record of last commit in routine {{{#!sh $ svn propset svn:keywords Id on ${WCPATH} }}} `svn:mime-type`: syntax highlighting and merging process `svn:executable`: executable permissions of shell scripts {{{#!sh $ svn propset svn:executable on ${WCPATH} }}} `svn:externals`: defining external sources Single external example {{{#!sh $ svn propset svn:externals ${URL}[@${REV}] ${WCPATH} }}} Multi externals example using an editor {{{#!sh $ svn propedit svn:externals ${WCPATH} }}} }}} |- {{{#!th Delete property }}} {{{#!td {{{#!sh $ svn propdel ${SVN_PROPERTY} ${WCPATH} }}} }}} == Branching / Merging {{{#!th Manage \\ branches }}} {{{#!td Creation {{{#!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} }}} Removal {{{#!sh $ svn rm {${URL},${WCPATH}} }}} }}} |- {{{#!th Merging \\ sources }}} {{{#!td {{{#!sh $ svn merge {${URL1},${WCPATH1}}[@${REV1}] [{${URL1},${WCPATH2}}[@${REV2}]] [${WCPATH}] }}} }}}