Help Topic: The SVN Add and Remove Commands


Maintained by: mikerb@mit.edu         Get PDF


The SVN add and remove Commands


The svn add command allows you add files or a directories to your locally checked out tree in preparation for committing them to the svn server. And as you may guess, the svn rm command tags a file in your local checkout for removal on the server upon your next commit. More info on svn add and svn rm can always be found by Googling "Subversion book" and reading the full PDF online free, or just typing svn help add anytime on the command line.

Basic usage of the svn add command    [top]


The basic syntax for the svn status command is:

  $ svn add my_file.cpp my_file.h        (one or more files)
  $ svn add my_project/                  (a directory) 

The svn add command does not require a network connection to the server and only declares an intention to add file(s) to the master copy on the svn server upon the next commit. Since svn status also doesn't require a network connection to the server, you can confirm the results of your add immmediately:

  $ svn status
  A       my_file.cpp
  A       my_file.h
  A       my_project

Note: When adding a directory, the operation is applied recursively to all files and subdirectories.

Note: When adding a file, don't be afraid to use the command line conveniences such as svn add *.pdf. If this matches a PDF that has already been added, you will get harmless error message for that file. It can be safely ignored, and you can assume all the previously unversioned PDF files will now be scheduled for addition.

Basic usage of the svn remove command    [top]


The basic syntax for the svn remove command (or rm for short) is:

  $ svn rm my_file.cpp my_file.h        (one or more files)
  $ svn rm my_project/                  (a directory) 

    The svn rm command does not require a network connection to the server and only declares an intention to remove the file(s) from the master copy on the svn server upon the next commit.

Note: If removing a directory with files that are unversioned (not under version control) the svn rm command will produce an error. The message will point out the unversioned file and inform you that you can use the svn --force rm option to remove a directory with unversioned files.


Document Maintained by: mikerb@mit.edu        
Page built from LaTeX source using texwiki, developed at MIT. Errata to issues@moos-ivp.org. Get PDF