wiki:pm-svn-cmds

Version 2 (modified by anonymous, 14 years ago) (diff)

--

Basic Commands

Below we list the subversion command line commands that a typical developer has to know about. Online help is available using svn help. A detailed description of each command can be found in the "Subversion Complete Reference" chapter of the subversion book, at http://svnbook.red-bean.com/nightly/en/svn.ref.html

svn help

Lists all available svn commands. Help for a specific command cmd can be obtained with svn help cmd.

svn checkout (short form: svn co)

Checks out a directory plus all subdirectories from a subversion repository. The COIN repositories are available from the URL https://www.coin-or.org/svn. For each project, say Prjct, you obtain everything in the current revision for the project, by specifying svn co https://www.coin-or.org/svn/Prcjt/; if you only want a part of the code, such as the current official release (by convention in the subdirecory trunk, you type svn co https://www.coin-or.org/svn/Prcjt/trunk. Usually, you should specify the target directory where you want your local copy of the code to be stored (such as Coin-Prjct). If the target directory is omitted, the source code will be installed in a subdirectory with the name of the last directory in the URL, i.e., trunk in the example above.

If you want to specify a specific revision that you want to check out, you can do this using the -r N flag, where N is the revision number.

By default, svn checkout will download files in other subversion directories, if svn externals are defined for directories in the specified URL, and will recurse to further locations if externals are defined there. If you don't want to download any externals, specify the --ignore-externals flag.

The COIN svn repository is set up in a way, so that everybody can download files, without having to provide a password. You will have to provide your id and password once, if you want to do a write action, such as svn submit.

svn update (short form: svn up)

Updates the local copy to the current version of the current directory and subdirectories, or of a specific directory, if it is given as argument (e.g., svn up subdir). If you have made changes in your local copy, subversion will try to merge the difference between the previously checked-out version and the new one. If it has trouble doing that, it will notify you of a conflict. You should then have a look at the files for which a conflict occured and fix it; the location of a conflict is marked by <<< and >>> strings. It is important that you resolve the conflict, either by using svn resolved or svn revert, because you will otherwise not be able to commit your changes.

The -r N flag allows you to update your local copy to a specific revision number (N). To avoid recursion into subdirectories during the update, use the -N flag. The --ignore-externals flags tells subversion to ignore the externals.

svn status (short form: svn st)

svn commit (short form: svn ci)

svn diff (short form: svn di)

svn revert

svn resolved

svn add

svn remove (short form: svn rm)

svn copy (short form: svn cp)

svn mkdir

svn merge

svn proplist (short form: svn plist)

svn propget (short form: svn pget)

svn propset (short form: svn pset)

svn propdel (short form: svn pdel)

svn export