Essential SVN Command Line Examples

Posted: April 1st, 2010 | Author: | Tags: , , | No Comments »

Checking out a Repo

svn co --username USER --password PASS http://svn.yourrepo.com/svn/someproject/trunk mydir

This command will checkout the remote path to a folder named “mydir” under the directory in which the command is issued.

Committing changes

svn ci

Recursively checks in all added or modified files under the current working directory.  By default this command will open a text editor where you can confirm the items being checked in and type a message.

What has changed?

svn status

Shows modified, conflicted, and unknown files recursively starting from the current working directory.

svn diff --revision 87 filename.rb

This command will display a unified diff comparing the current working version to revision 87.

svn update

Updates working copy to latest revision.

Ignoring Files

svn propedit svn:ignore /path/to/directory/holding/your/file

This  command will bring up a nano edit screen where you can add line delimited ignore properties. If you want to ignore all files within a directory, you would simply enter “*” in this editor window. Save the file, return to the command line, and do a quick “svn status” to make sure your settings took.