[root@v01 online]# svn diff -r 9:8 Index: index.html =================================================================== --- index.html (revision 9) +++ index.html (revision 8) @@ -10,4 +10,3 @@ kkkkkkkkkkk kkkkkkkk ggggggg -10 [root@v01 online]# svn merge -r 9:8 "" --- Reverse-merging r9 into '.': U index.html [root@v01 online]# cat index.html <<<<<<< .mine kkkkk 2222 kkkkkllll ======= 999999 8888888 9999999999999 >>>>>>> .r5 kkkkkkkkkkk kkkkkkkk ggggggg [root@v01 online]# svn diff “” Index: index.html =================================================================== --- index.html (revision 9) +++ index.html (working copy) @@ -10,4 +10,3 @@ kkkkkkkkkkk kkkkkkkk ggggggg -10 [root@v01 online]# svn commit -m "sss" Sending index.html Transmitting file data . Committed revision 10. [root@v01 online]# svn log index.html ------------------------------------------------------------------------ r10 | user001 | 2016-05-10 03:02:21 +0800 (Tue, 10 May 2016) | 1 line sss ------------------------------------------------------------------------ r9 | user001 | 2016-05-10 02:20:13 +0800 (Tue, 10 May 2016) | 1 line ------------------------------------------------------------------------ r8 | user001 | 2016-05-10 02:13:37 +0800 (Tue, 10 May 2016) | 1 line ------------------------------------------------------------------------ r7 | user001 | 2016-05-10 01:54:53 +0800 (Tue, 10 May 2016) | 1 line ------------------------------------------------------------------------ r6 | user001 | 2016-05-10 01:53:49 +0800 (Tue, 10 May 2016) | 1 line ------------------------------------------------------------------------ r4 | user001 | 2016-05-10 01:27:00 +0800 (Tue, 10 May 2016) | 1 line ------------------------------------------------------------------------ r3 | user001 | 2016-05-10 01:21:36 +0800 (Tue, 10 May 2016) | 1 line ------------------------------------------------------------------------ r2 | user001 | 2016-05-09 19:48:15 +0800 (Mon, 09 May 2016) | 1 line add test file for mytest ------------------------------------------------------------------------ r1 | user001 | 2016-05-09 13:19:28 +0800 (Mon, 09 May 2016) | 1 line ------------------------------------------------------------------------ [root@v01 online]#
svn log -v 显示所有日志 并带修改的文件名 svn log -r ver1:ver2 显示2个版本之间的改动 svn diff -r ver1:ver2 版本回滚 综上,最必要的就是3个步骤: 1. 确定版本号 svn log <file> 2. 合并 svn merge -r <latest revision>:<last revision> <file> 3. commit. svn ci -m 'rollback to last revision:' <file>
===================2016-08-09==============================================
[root@NGINX-APACHE-SVN vhosts]# svn log -r 109:110 default.conf.bak ------------------------------------------------------------------------ r109 | svnroot | 2016-08-05 15:55:42 +0800 (Fri, 05 Aug 2016) | 1 line 线上业务配置 ------------------------------------------------------------------------ r110 | svnroot | 2016-08-05 16:07:43 +0800 (Fri, 05 Aug 2016) | 1 line 解决default.conf.bak乱码问题
[root@NGINX-APACHE-SVN vhosts]# svn merge default.conf.bak -r 110:109 --- Reverse-merging r110 into 'default.conf.bak': U default.conf.bak [root@NGINX-APACHE-SVN vhosts]# svn st M default.conf.bak [root@NGINX-APACHE-SVN vhosts]# svn ci -m "" Sending vhosts/default.conf.bak Transmitting file data . Committed revision 111.