理解SVN关键词BASE,HEAD,COMMITTED,PREV

   SVN是以版本号(revision number)来记录版本库的每一次改变,一般的SVN操作不需要用到版本号,但是有些SVN操作需要指定版本号。我们可以指定一个明确的整数版本号,但是也可以使用SVN关键字来指代某个特殊的版本号,SVN会真正计算出它所指代的实际整数版本号:

   HEAD:版本库中最新的版本;

   BASE:某个工作副本项的版本,注意这个是你上次update该项时的版本号,可能晚于当前最新的版本号;

 COMMITTED:某个工作副本项最近修改的版本,与BASE相同或更早;

   PREV:COMMITTED - 1。

   HEAD针对于版本库,另外3个针对于某个工作副本目录或文件。

   示例:

  $ svn diff -r PREV:COMMITTED foo.c
  # shows the last change committed to foo.c


  $ svn log -r HEAD
  # shows log message for the latest repository commit


  $ svn diff -r HEAD
  # compares your working copy (with all of its local changes) to the latest version of that tree in the repository


  $ svn diff -r BASE:HEAD foo.c
  # compares the unmodified version of foo.c with the latest version of foo.c in the repository


  $ svn log -r BASE:HEAD
  # shows all commit logs for the current versioned directory since you last updated


  $ svn update -r PREV foo.c
  # rewinds the last change on foo.c, decreasing foo.c's working revision


  $ svn diff -r BASE:14 foo.c
  # compares the unmodified version of foo.c with the way foo.c looked in revision 14

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值