Help Topic: The SVN Move Command


Maintained by: mikerb@mit.edu         Get PDF


The SVN move Command


The svn mv command allows you to change the name of a file or directory in a locally checked out repository while retaining the history of the file or directory. More info on svn mv can always be found by Googling "Subversion book" and reading the full PDF online free, or just typing svn help mv anytime on the command line.

Basic usage of the svn mv command    [top]


The basic syntax for the svn status command is:

  $ svn mv alpha.cpp beta.cpp
  A      beta.cpp
  D      alpha.cpp

The svn mv command does not require a network connection to the server and only declares an intention to make a set of changes to the master copy on the svn server upon the next commit.

In looking at the above output, it may seem that invoking svn mv is the same as:

  $ cp alpha.cpp bravo.cpp
  $ svn add bravo.cpp
  $ svn rm alpha.cpp

When done this way, the history of changes to alpha.cpp will be lost. If you were to invoke svn log bravo.cpp, you would only see one entry, and perhaps lose valuable log information about who and what changed in alpha.cpp over time. By using svn mv this log history is retained and carried over to bravo.cpp.


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