svn中的revert和update

今天有人问到revert和update的问题。
刚开始还真被问住了。
因为感觉revert和update都可以将本地的copy更新到以前的一个版本,会有什么不同呢? 查了些资料,并做了个试验,终于发现了它们的不同。 假设当前最新的版本是6,但是,最新的一次提交不是你想要的,也就是想把版本为6的修改干掉
下面来看看如何分辨用revert和update来实现。 、使用revert
保证本地copy为最新版本,即版本6.
将本地copy revert到版本5.
将本地copy commit。 、使用update
将本地copy update到版本5.
这个时候是没办法直接提交的,因为你的修改不是在最新的版本()上进行的。
需要把版本5做个备份,然后check out版本6.
通过文件比较工具将版本6的本地copy修改为与版本5的本地copy一致。
然后将版本6的本地copy提交。 可见,revert与update的本质区别是,
revert是在本地copy原来版本的基础上进行的修改,若原来本地copy的版本为最新,可以直接commit;
update只是将本地copy更新到一个指定的版本,若更新到的不是最新版本,不能进行commit。 可见revert就是回退修改,但版本保持不变;update是将本地copy更新到一个指定的版本。 看看帮助文档中的说明。 [revert]
revert: Restore pristine working copy file (undo most local edits).
usage: revert PATH... Note: this subcommand does not require network access, and resolves
any conflicted states. However, it does not restore removed directories. [update]
update (up): Bring changes from the repository into the working copy.
usage: update [PATH...] If no revision is given, bring working copy up-to-date with HEAD rev.
Else synchronize working copy to revision given by -r. For each updated item a line will start with a character reporting the
action taken. These characters have the following meaning: A Added
D Deleted
U Updated
C Conflict
G Merged
E Existed A character in the first column signifies an update to the actual file,
while updates to the file's properties are shown in the second column.
A 'B' in the third column signifies that the lock for the file has
been broken or stolen. If --force is used, unversioned obstructing paths in the working
copy do not automatically cause a failure if the update attempts to
add the same path. If the obstructing path is the same type (file
or directory) as the corresponding path in the repository it becomes
versioned but its contents are left 'as-is' in the working copy.
This means that an obstructing directory's unversioned children may
also obstruct and become versioned. For files, any content differences
between the obstruction and the repository are treated like a local
modification to the working copy. All properties from the repository
are applied to the obstructing path. Obstructing paths are reported
in the first column with code 'E'. Use the --set-depth option to set a new working copy depth on the
targets of this operation.

SVN的revert和update命令的区别的更多相关文章

  1. 版本控制-svn服务器搭建和常用命令(centos 6.3)

    Svn是比较优秀的版本控制工具,虽然功能和性能上无法和Git媲美,但由于其容易搭建和使用的特性,所以在各个小公司还是很受欢迎的.使用Git可参考<版本控制-Git服务器搭建和常用命令使用> ...

  2. 版本控制-https svn服务器搭建和常用命令(centos 6.3)

    Svn是比较优秀的版本控制工具,虽然功能和性能上无法和Git媲美,但由于其容易搭建和使用的特性,所以在各个小公司还是很受欢迎的.使用Git可参考<版本控制-Git服务器搭建和常用命令使用> ...

  3. [转]Ubuntu中apt与apt-get命令的区别

    转载于https://www.sysgeek.cn/apt-vs-apt-get/ Ubuntu 16.04 发布时,一个引人注目的新特性便是 apt 命令的引入.其实早在 2014 年,apt 命令 ...

  4. Unity游戏暂停之Update与FixedUpdate区别

    游戏暂停 示例程序 下面这段代码演示游戏暂停 using UnityEngine; using System.Collections; public class GamePauseTest : Mon ...

  5. git revert 和 git reset的区别

    git revert 撤销 某次操作,此次操作之前和之后的commit和history都会保留,并且把这次撤销 作为一次最新的提交    * git revert HEAD               ...

  6. git的几种回滚 git revert 和 git reset的区别

    git的几种回滚 git revert 和 git reset的区别:强烈建议:对HEAD不熟的话最好不要用HEAD,直接用commitID吧,我遇到的问题:reset HEAD~1之后,可能是别人提 ...

  7. Linux 休眠,挂起(待机),关机等几个命令的区别及如何实现;如何启用Ubuntu的休眠模式

    这里对linux 的几个命令整理下,有:休眠,挂起,待机,关机等几个命令的区别及如何实现. 休眠是一种更加省电的模式,它将内存中的数据保存于硬盘中,所有设备都停止工作.当再次使用时需按开关机键,机器将 ...

  8. svn查看代码作者的命令

    svn blame **.java | grep ** svn查看代码作者的命令

  9. [转]oracle for update和for update nowait的区别

    1概念小结:(针对以下引用区域内容) 1.1 普通select语句不加锁. 1.2 for update和for update nowait都试图将符合条件的数据加上行级锁.用于排斥其他针对这个表的写 ...

随机推荐

  1. 创建采购订单批到程序用的BAPI

    CALL FUNCTION 'BAPI_PO_CREATE1' EXPORTING poheader = poheader poheaderx = poheaderx * POADDRVENDOR = ...

  2. linux脚本初体验

    前言 第一次写linux脚本,有点紧张. 1. 写一个寻找特定用户的脚本文件? #! /bin/sh who | grep $1 其中脚本第一行用来告诉kernel去使用/bin/sh来解释这个脚本: ...

  3. Spark大型项目实战:电商用户行为分析大数据平台

    本项目主要讲解了一套应用于互联网电商企业中,使用Java.Spark等技术开发的大数据统计分析平台,对电商网站的各种用户行为(访问行为.页面跳转行为.购物行为.广告点击行为等)进行复杂的分析.用统计分 ...

  4. RPC 的概念模型与实现解析(转)

    今天分布式应用.云计算.微服务大行其道,作为其技术基石之一的 RPC 你了解多少?一篇 RPC 的技术总结文章,数了下 5k+ 字,略长,可能也不适合休闲的碎片化时间阅读,可以先收藏抽空再细读:) 全 ...

  5. FatMouse&#39; Trade(杭电1009)

    FatMouse' Trade Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Tot ...

  6. svn强制用户提交时写日志

    #!/bin/sh REPOS="$1" TXN="$2" SVNLOOK=/usr/bin/svnlook #根据你的SVN目录而定 LOGMSG=`$SVN ...

  7. 原型链(__proto__)

    前面详细的解释了new的几个步骤,其中随意带过了一下原型链的概念,如果细读那篇文章,基本对原型也能有所理解. 原型有两个关键属性,一个是 __proto__ 一个是 prototype ,了解了这两个 ...

  8. 在VC++中启用内存泄露检测

    检测内存泄漏的主要工具是调试器和 CRT 调试堆函数.若要启用调试堆函数,请在程序中包括以下语句: #define CRTDBG_MAP_ALLOC#include <stdlib.h># ...

  9. Linux内核驱动开发之KGDB原理介绍及kgdboe方式配置

    接博文<Linux内核驱动开发之KGDB单步调试内核(kgdboc方式)>.上篇博文中,仅简单介绍使用串口的Kgbd的流程(kgdboc方式),本文将重点介绍KGDB调试Linux内核的原 ...

  10. C# split字符串 依据1个或多个空格

    实例场景.对于字符串:"AAAA AAA        BBBB BBB BBB        CCCCCCCC". 1. 分隔为 "AAAA AAA" . & ...