Monday, December 27, 2010

Preserve the history while re-adding a file to Subversion

To re-add a file previously deleted in Subversion execute this command...

svn copy --revision [rev number] [path to file in repository] [path on local file system to copy to]

... then commit the file. This will retain the history of the file.

Here's an example:

(1) svn copy --revision 20471 http://tools.symposium.org/svn/smp/dev/config/classes/velocity/donor/feedback.vm config/classes/velocity/donor/feedback.vm

(2) svn commit -m "resurrected feedback.vm from rev 20471" config/classes/velocity/donor/feedback.vm