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

By Alvin J. Alexander, devdaily.com

Moving a directory (or file) with Subversion (SVN) is very easy. Let's try a simple example.

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

svn move foo bar

You'll then want to commit the change. You can either do this now, or some time later, but let's assume you want to do it now:

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

To make this a little harder, assume that you want to move foo up one level in the directory tree. Just issue these commands instead:

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

As you can see, this is still very simple. If you want to move files with SVN just use the same command syntax.


devdaily logo