打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
理解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

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
linux下svn的使用
SVN常用命令参考
TortoiseSVN客户端命令
Git 使用手冊 | TKG
Git高级使用教程
在线代码审查工具
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服