Version 57 (modified by nicolasmartin, 23 months ago) (diff)

SVN quick reference

Last edition on 05/18/20 09:05:57 by smasson

For reference, browse to

## 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:
##- developer svn+ssh://${ID}

${WCPATH} # Working Copy PATH

Basic use


Branching / Merging

Download a working copy

$ svn {checkout,co} [${WCPATH}]

Add/Remove item (file or folder)

$ svn {add,del,rm} ${WCPATH}

Informations on working copy

$ svn info [{${WCPATH},${URL}}][@${REV}]

Local status wrt the repository

$ svn status [-[qu]] [${WCPATH}]

Local changes

$ svn {diff,revert} ${WCPATH}

Push modififcations to repository

$ svn {ci,commit} [-m 'one-liner message'] [${WCPATH}]

For modified externals, add --include-externals option

List commit messages

$ svn log [{${URL},${WCPATH}}[@${REV}]]

svn:keywords Id: record commit infos in routine

$ svn propset svn:keywords Id on ${WCPATH}

svn:mime-type: syntax highlighting and merging process

$ svn propset svn:mime-type ... ${WCPATH}

svn:executable: set permissions for scripts

$ svn propset svn:executable on ${WCPATH}

svn:externals: defining external sources

  • Single external
    $ svn propset svn:externals ${URL}[@${REV}] ${WCPATH}
  • Multi externals
    $ svn propedit svn:externals ${WCPATH}

Create a branch (copying)

$ 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!! )
    $ 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
    $ svn switch --relocate ${URL1} ${URL2}

Merging sources

$ svn merge {${URL1},${WCPATH1}}[@${REV1}] [{${URL1},${WCPATH2}}[@${REV2}]] [${WCPATH}]

Remove a branch

$ svn rm {${URL},${WCPATH}}