简体   繁体   中英

Altering Revision History with SVN

Some files in my source repository at work were moved around. Rather than performing a "svn mv $file" operation, the files were moved using "svn rm $old_location/$file" and "SVN add $new_location/$file".

Most of the files are named the same, but are now in different directories. Is there a way to add back the revision history using SVN? I have a map of the old file locations to the new file locations, so it would be nice if I could write a script to do this.

Use svnadmin to dump your repository until the revision, in this example 3500, before these unwanted moves took place. Delete the repository and reload the dump file.

svnadmin dump RepositoryURL -r0:3500 > svn.dump
rm URL
svnadmin load RepositoryURL < svn.dump

也可以使用dumpfilter选项执行上述操作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM