Download PPT:
Click here to download the code PPT
Http://p.blog.csdn.net/images/p_blog_csdn_net/dedodong/cvsppt.gif
Note: Right-click the file and choose Save As. After the file is downloaded, set the file suffix GIF to RAR.
PPT content:
CVS Introduction
CVS (cuncurrent Versions System)
A version control tool based on TCP/IP protocol is also one of the most important development tools in the Open Source Field.
It used to work mainly on UNIX platforms, and now many GUI tools are available on Windows platforms.
CVS adopts the Client/Server structure. You must prepare a directory for cvs repository locally to synchronize the source code with the server.
CVS and VSS (visual source safe)
There are two differences:
First, VSS relies on a shared directory on the server to provide services. Each client must be able to access this shared directory. This makes it difficult to use source safe in a TCP/IP environment. For Working Groups distributed across several cities or even countries, only through VPN can the source safe database be securely accessed. (Sourcegear (www.sourcegear.com) releases a commercial software package named sourceoffsite, which is US $239 per user. It can also provide remote users with the ability to access source safe data through TCP/IP .) CVS relies on TCP/IP connections to provide services, so it was designed to work collaboratively on the Internet. Although the basic pserver connection is not highly secure, high security can be achieved through SSH.
CVS and VSS (visual source safe)
Ii. CVs opposes the file lock mechanism.
VSS and many other traditional version control tools require that a file can only have one user. It must first checkout to declare the exclusive right to edit the file until checkin ends. However, for CVs, which geographically does not limit the user location, it is a pain to wait for a user checkin, and mutual communication is more difficult than a closely working group. CVS allows multiple users to edit a file at the same time and then commit the file to solve this problem. If there is a conflict due to insufficient communication, the user must manually resolve the conflict before committing it. In this case, conflicting developers must try to communicate with each other to avoid further conflicts.
1. Installation
1. Download:
Ftp.gnu.org/non-gnu/cvs/ or a convenient place to download.
It is best to select the stable version.
Cvs-1.11.22.tar.gz
1. Installation
2. Compile:
Ddd @ dedodong:/Media/B $ tar-xzvf cvs-1.11.22.tar.gz
Ddd @ dedodong:/Media/B $ CD cvs-1.11.22/
Ddd @ dedodong:/Media/B/cvs-1.11.22 $./configure
Root @ dedodong:/Media/B/cvs-1.11.22 # Make
Root @ dedodong:/Media/B/cvs-1.11.22 # make install
Ii. Configuration
2.1 Add a service Port:
View the configuration file:
$ CAT/etc/services | grep cvspserver
Check whether the following services exist. If not, add them as needed.
Cvspserver 2401/tcp # CVS client/server operations
Cvspserver 2401/udp # CVS client/server operations
Ii. Configuration
2.2
Create a CVS Repository:
Root @ dedodong:/# mkdir/Media/B/cvsroot
Root @ dedodong:/# CVS-D/Media/B/cvsroot init
Change the/Media/B/cvsroot permission so that all users can access
Root @ dedodong:/# chmod-r OGU + WRX/Media/B/cvsroot
Ii. Configuration
2.3 create a STARTUP script:
2.3.1
Create a file: root @ dedodong:/# vi/etc/xinetd. d /***
Add the following content:
Service cvspserver
{
Disable = No
Flags = Reuse
Socket_type = stream
Wait = No
User = root
Server =/usr/local/bin/CVS
Server_args =-f -- allow-root =/Media/B/cvsroot pserver
}
Ii. Configuration
2.3.2
Edit the/etc/inetd. conf file:
Root @ dedodong:/# vi/etc/inetd. conf
Add the following content:
Cvsserver stream tcp Nowait root/usr/local/bin/CVS-f -- allow-root =/Media/B/cvsroot pserver
Ii. Configuration
2.4 restart services:
1: xined
Root @ dedodong: // #/etc/rc. d/init. d/xined restart
2: inetd
Root @ dedodong:/# killall-hup inetd
Ii. Configuration
2.5 check whether the CVS server is running:
Root @ dedodong:/# netstat-LNP | grep 2401
Ii. Configuration
2.6 create a CVS group and user:
Root @ dedodong:/Media/B/cvs-1.11.22 # groupadd CVS
Root @ dedodong:/Media/B/cvs-1.11.22 # useradd cvsroot-G CVS
Root @ dedodong:/Media/B/cvs-1.11.22 #
Passwd cvsroot
Iii. Use
3.1 login:
CVS-D: pserver: cvsroot @ localhost:
/Media/B/cvsroot Login
Iii. Use
3.2 Create a project:
CVS import my_so urce_code_dir v1_0 r1_0
Iii. Use
3.3 Export Project:
CVS checkout Project
Iii. Use
3.4 Update Project:
CVS update: update all subdirectories
CVS update file_name update a single file
Iii. Use
3.5 submit the project:
CVS commit-M "write some comments here": Submit all subdirectories. Remember to add comments!
CVS commit-M "write some comments here" file_name: submit a single file
Iii. Use
3.6 Add a file or directory:
CVS add myfile
CVS commit myfile takes effect immediately
Iii. Use
3.7 deleting a file or directory:
Physical deletion is required !!!
Cvs rm myfile
CVS commit myfile