版本管理:RCS之命令基础篇

本文介绍了RCS,一个古老的版本控制系统,详细讲解了如何安装、使用checkin、checkout、rcsdiff、创建branch、rlog、修改注释、管理symbolic names以及删除版本等基本操作。RCS虽然简单,但功能齐全,对于理解版本管理原理非常有帮助。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

RCS作为非常古老的版本工具,远远在SVN和已经退役的CVS之前。它的古老程度应该比Web开发的ASP前代的CGI还要久远。但是作为非常简单的文本格式的版本管理工具,它使用时间跨度之久令人惊奇。如果想对版本管理实现方式进行深入研究的话,RCS提供了一种最为简单的方式,,v文件是RCS的全部,以文本形式存放,简单易读,对于想深入了解版本管理或者想开发类似工具的开发者来说,绝对是可以借鉴的。

安装

比如像centos等,新的centos7之前应该都是被缺省安装的。如果没有的话,yum install rcs即可。230k左右的package,可以完成很多的功能。

===================================================================================================================================================
 Package                         Arch                               Version                                 Repository                        Size
===================================================================================================================================================
Installing:
 rcs                             x86_64                             5.9.0-5.el7                             base                             230 k

Transaction Summary
===================================================================================================================================================

版本确认

[root@host31 ~]# rcs --version
rcs (GNU RCS) 5.9.0
Copyright (C) 2010-2013 Thien-Thi Nguyen
Copyright (C) 1990-1995 Paul Eggert
Copyright (C) 1982,1988,1989 Walter F. Tichy, Purdue CS
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[root@host31 ~]#

checkin命令:ci

准备

[root@host31 ~]# mkdir -p /local/testrcs
[root@host31 ~]# cd /local/testrcs
[root@host31 testrcs]# mkdir RCS
[root@host31 testrcs]# echo "#include <stdio.h>" >hello.h

checkin命令:ci

[root@host31 testrcs]# ci hello.h
RCS/hello.h,v  <--  hello.h
enter description, terminated with single '.' or end of file:
NOTE: This is NOT the log message!
>> initial version
>> .
initial revision: 1.1
done
[root@host31 testrcs]#

checkin后的确认,发现文件不见了,只有RCS下生成的,v文件了

[root@host31 testrcs]# ll
total 0
drwxr-xr-x. 2 root root 22 Aug 15 21:48 RCS
[root@host31 testrcs]# ll RCS
total 4
-r--r--r--. 1 root root 213 Aug 15 21:48 hello.h,v
[root@host31 testrcs]# cat RCS/hello.h,v
head    1.1;
access;
symbols;
locks; strict;
comment @ * @;


1.1
date    2016.08.15.17.47.54;    author root;    state Exp;
branches;
next    ;


desc
@initial version
@


1.1
log
@Initial revision
@
text
@#include <stdio.h>
@
[root@host31 testrcs]#

再看hello.h,v文件你会清晰地发现版本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值