svn move - how to move a directory with svn

SVN directory FAQ: How do I move a directory with subversion (svn)?

svn directory move example

Moving a directory (or file) with Subversion (SVN) is very easy, you just need to use the "svn move" command. Let's try a simple example.

Suppose you have a directory named foo, and you want to rename it to bar. The svn move command to issue is:

svn move foo bar

After moving the directory you'll then want to commit the change. You can either do this now, or some time later, but assuming you want to do it now, you can commit the move with this svn commit command:

svn commit --message "Moved foo to bar because (explanation here)"

svn move example #2

To make our SVN directory move example a little harder, let's assume that you want to move foo up one level in the directory tree. Just issue these commands instead:

svn move foo ../bar
cd ..
svn commit --message "Moved foo to bar because (explanation here)"

As you can see, this is still very simple, and much easier than with CVS.

As a final note, if you want to move files with SVN, just use the same command syntax as shown here.