⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 12.htm

📁 debian参考手册,pdf格式的版本。
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0062)http://qref.sourceforge.net/Debian/reference/ch-vcs.zh-cn.html -->
<HTML><HEAD><TITLE>Debian 参考手册 - 系统版本控制</TITLE>
<META http-equiv=content-type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.3790.118" name=GENERATOR></HEAD>
<BODY><A name=ch-vcs></A>
<HR>
[ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-edit.zh-cn.html">上一页</A> ] 
[ <A 
href="http://qref.sourceforge.net/Debian/reference/reference.zh-cn.html#contents">目录</A> 
] [ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-preface.zh-cn.html">1</A> 
] [ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-system.zh-cn.html">2</A> ] 
[ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-install.zh-cn.html">3</A> 
] [ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-tutorial.zh-cn.html">4</A> 
] [ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-woody.zh-cn.html">5</A> ] 
[ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-package.zh-cn.html">6</A> 
] [ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-kernel.zh-cn.html">7</A> ] 
[ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-tips.zh-cn.html">8</A> ] [ 
<A href="http://qref.sourceforge.net/Debian/reference/ch-tune.zh-cn.html">9</A> 
] [ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-gateway.zh-cn.html">10</A> 
] [ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-edit.zh-cn.html">11</A> ] 
[ 12 ] [ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-program.zh-cn.html">13</A> 
] [ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-gnupg.zh-cn.html">14</A> ] 
[ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-support.zh-cn.html">15</A> 
] [ <A 
href="http://qref.sourceforge.net/Debian/reference/ap-appendix.zh-cn.html">A</A> 
] [ <A 
href="http://qref.sourceforge.net/Debian/reference/ch-program.zh-cn.html">下一页</A> 
] 
<HR>

<H1>Debian 参考手册 <BR>第 12 章 - 系统版本控制 </H1>
<HR>
<A name=s-cvs></A>
<H2>12.1 CVS</H2>
<P>有关的详细信息可使用<CODE>lynx</CODE>查阅<CODE>/usr/share/doc/cvs/html-cvsclient</CODE>,<CODE>/usr/share/doc/cvs/html-info</CODE>,<CODE>/usr/share/doc/cvsbook</CODE>或执行<SAMP>info 
cvs</SAMP>及<SAMP>man cvs</SAMP>。 
<HR>
<A name=s-cvs-inst></A>
<H3>12.1.1 安装CVS服务器</H3>
<P>以下步骤配置的服务器,仅允许“src”用户组的成员访问CVS容器,并且仅“staff”用户组的成员才可管理CVS,这样做可以降低管理者不小心犯错的机率。 <PRE>     # cd /var/lib; umask 002 ; sudo mkdir cvs # [Woody] FSH
     # apt-get install cvs cvs-doc cvsbook
     # export CVSROOT=<VAR>/var/lib/cvs</VAR>
     # cd $CVSROOT
     # chown root:src .  # 设置为"staff"可加强对新建项目行为的限制
     # chmod 3775 .             # 如果上面的赋值为"staff",则使用2775
     # cvs -d <VAR>/var/lib/cvs</VAR> init # 在此明确地指定-d更安全
     # cd CVSROOT
     # chown -R root:staff .
     # chmod 2775 .
     # touch val-tags 
     # chmod 664 history val-tags
     # chown root:src history val-tags
</PRE>
<HR>
<A name=s-cvs-examples></A>
<H3>12.1.2 CVS会话例子</H3>
<P>下面我们来设置shell环境以便访问CVS容器。 
<HR>
<A name=s12.1.2.1></A>
<H4>12.1.2.1 匿名CVS(仅用于下载)</H4>
<P>只读远程访问: <PRE>     $ export CVSROOT=:pserver:<VAR>anonymous@cvs.qref.sf.net:/cvsroot/qref</VAR>
     $ cvs login
     $ cvs -z3 co <VAR>qref</VAR>
</PRE>
<HR>
<A name=s12.1.2.2></A>
<H4>12.1.2.2 使用本地CVS服务器</H4>
<P>通过同一台机器上的shell进行本地访问: <PRE>     $ export CVSROOT=<VAR>/var/lib/cvs</VAR>
</PRE>
<HR>
<A name=s12.1.2.3></A>
<H4>12.1.2.3 使用远程CVS pserver</H4>
<P>非SSH(在<CODE>cvs</CODE>中使用RSH协议)远程访问: <PRE>     $ export CVSROOT=:pserver:<VAR>account@cvs.foobar.com:/var/lib/cvs</VAR>
     $ cvs login
</PRE>
<P>易受窍听攻击。 
<HR>
<A name=s12.1.2.4></A>
<H4>12.1.2.4 通过<CODE>ssh</CODE>使用远程CVS</H4>
<P>通过SSH进行远程访问: <PRE>     $ export CVSROOT=:ext:<VAR>account@cvs.foobar.com:/var/lib/cvs</VAR>
</PRE>
<P>或连接Sourceforge: <PRE>     $ export CVSROOT=:ext:<VAR>account@cvs.qref.sf.net:/cvsroot/qref</VAR>
</PRE>
<P>亦可使用RSA认证(<A 
href="http://qref.sourceforge.net/Debian/reference/ch-tune.zh-cn.html#s-ssh-rsa">用更少的密码建立连接, 
第 9.5.3 节</A>),它不需要密码提示。 
<HR>
<A name=s12.1.2.5></A>
<H4>12.1.2.5 新建CVS档案</H4>
<P>要建立如下的档案, <PRE>     ITEM              VALUE                    MEANING
     source tree:      ~/<VAR>project-x</VAR>              All source codes
     Project name:     <VAR>project-x</VAR>                Name for this project
     Vendor Tag:       <VAR>Main-branch</VAR>              Tag for the entire branch
     Release Tag:      <VAR>Release-original</VAR>         Tag for a specific release
</PRE>
<P>则, <PRE>     $ cd ~/<VAR>project-x</VAR>                 # 进源码目录
      ... 创建源码树 ...
     $ cvs import -m <VAR>"Start project-x" project-x Main-branch Release-initial</VAR>
     $ cd ..; rm -R ~/<VAR>project-x</VAR>
</PRE>
<HR>
<A name=s12.1.2.6></A>
<H4>12.1.2.6 使用CVS</H4>
<P>使用本地CVS容器来为<VAR>project-x</VAR>工作: <PRE>     $ cd                            # 转到工作域
     $ cvs co <VAR>project-x</VAR>              # 从CVS下载源码到本地
     $ cd <VAR>project-x</VAR>
      ... 修改源码内容 ...
     $ cvs diff -u                   # 相当于diff -u repository/ local/
     $ cvs up -C <VAR>modified_file</VAR>       # 撤消对文件地修改
     $ cvs ci -m "<VAR>Describe change</VAR>"   # 保存本地源码到CVS
     $ vi <VAR>newfile_added</VAR>
     $ cvs add <VAR>newfile_added</VAR>
     $ cvs ci -m "<VAR>Added newfile_added</VAR>"
     $ cvs up                        # 从CVS合并最新版本
      ... watch out for lines starting with "C <VAR>filename</VAR>"
      ... unmodified code is moved to `.#<VAR>filename</VAR>.version'.
      ... Search "&lt;&lt;&lt;&lt;&lt;&lt;&lt;" and "&gt;&gt;&gt;&gt;&gt;&gt;&gt;" in <VAR>filename</VAR>.
     $ cvs tag <VAR>Release-1</VAR>             # 添加release tag
      ... edit further ...
     $ cvs tag -d <VAR>Release-1</VAR>          # 移除release tag
     $ cvs ci -m "<VAR>more comments</VAR>"
     $ cvs tag <VAR>Release-1</VAR>             # 重新添加release tag
     $ cd                            # 返回工作域
     $ cvs co -r <VAR>Release-initial</VAR> -d <VAR>old</VAR> <VAR>project-x</VAR>
      ... get original version to <VAR>old</VAR> directory
     $ cd old
     $ cvs tag -b <VAR>Release-initial-bugfixes</VAR> # 创建branch (-b) tag
      ... Now you can work on the old version (Tag=sticky)
     $ cvs update
      ... Source tree now has sticky tag "Release-initial-bugfixes"
      ... Work on this branch
     $ cvs up # sync with files modified by others on this branch
     $ cvs ci -m "<VAR>check into this branch</VAR>"
     $ cvs update -kk -A
      ... Remove sticky tag and forget contents
      ... Update from main trunk without keyword expansion
     $ cvs update -kk -j <VAR>Release-initial-bugfixes</VAR>
      ... Merge from <VAR>Release-initial-bugfixes</VAR> branch into the main 
      ... trunk without keyword expansion.  Fix conflicts with editor.
     $ cvs ci -m "<VAR>merge Release-initial-bugfixes</VAR>"
     $ cd
     $ tar -cvzf <VAR>old-project-x.tar.gz</VAR> <VAR>old</VAR>     # make archive, -j for bz2
     $ cvs release -d <VAR>old</VAR>               # 删除本地源码(可选)
</PRE>
<P>应该记住的几个选项(用作<CODE>cvs</CODE>命令行的第一个参数): <PRE>     -n      dry run, no effect
     -t      display messages showing steps of cvs activity
</PRE>
<HR>
<A name=s12.1.2.7></A>
<H4>12.1.2.7 从CVS取文件</H4>
<P>要从CVS获得最新版本,用“tomorrow”: <PRE>     $ cvs ex -D tomorrow <VAR>module_name</VAR>
</PRE>
<HR>
<A name=s12.1.2.8></A>
<H4>12.1.2.8 管理CVS</H4>
<P>为项目添加别名(本地服务器): <PRE>     $ su - admin           # staff用户组成员
     $ export CVSROOT=<VAR>/var/lib/cvs</VAR>
     $ cvs co CVSROOT/modules
     $ cd CVSROOT
     $ echo "<VAR>px</VAR> -a <VAR>project-x</VAR>" &gt;&gt;modules
     $ cvs ci -m "<VAR>Now px is an alias for project-x</VAR>"
     $ cvs release -d .
     $ exit                 # 按control-D从su返回
     $ cvs co -d <VAR>project</VAR> <VAR>px</VAR> 
      ... check out <VAR>project-x</VAR> (alias:<VAR>px</VAR>) from CVS to directory project
     $ cd project
      ... make changes to the content ...

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -