CVS client commands in Linux

Source: Internet
Author: User
Tags ssh access

I recently used CVS because of work needs. I found an article about client commands, so I will forget it here.

Source: http://hi.baidu.com/fyiucn/blog/item/bcdb9742230a971b9213c68c.html

I. Basic Knowledge:

Cvsroot

Before you start, you need to understand the basic knowledge of CVS. First, to connect to the CVS resource library, you need to know the path named "cvsroot. Cvsroot is a string, just like a URL, which tells the CVS command where the remote resource library is located and how to connect to it. In addition, depending on whether the CVS resource library is local or remote, and how it is connected, CVS also has many different cvsroot formats. Here are some cvsroot examples with explanations.

Local cvsroot

Cvsroot =/home/cvsroot
This is an example of a local cvsroot path. If you want to connect to a local resource library that exists in/home/cvsroot, or you want to have a resource library installed in/home/cvsroot through NFS, csrooot needs to be used like this.

Cvsroot

Cvsroot =: pserver: cvs@foo.bar.com:/home/cvsroot
Here is a cvsroot example of a remote resource library, which is located on the foo.bar.com host and active in the/home/cvsroot directory of this machine. ": Pserver:" Tell our client to connect to this remote machine using the CVS password server protocol, which is built in CVS. Generally, the public CVS resource library uses the password server protocol to allow anonymous users to access it.

Remote rsh/ssh cvsroot

Cvsroot = drobbins@foo.bar.com:/data/CVS
This is an example of cvsroot using the RSH or SSH protocol. In this example, the CVS server tries to use the drobbing account to access the resource library on foo.bar.com. If the environment variable of cvs_rsh is set to "ssh", our client will try to use SSH to connect; otherwise, RSH will be used. Users who focus on security often use SSH access. However, both RSH and SSH methods cannot provide anonymous users with a way to obtain the source code. To use this method, you must have a Logon account on foo.bar.com.
In addition to cvsroot, you also need to know the name of the module (source code set) to be checked out and the anonymous password used to log on to the CVS password server. Unlike anonymous FTP, there is no "standard" format for anonymous passwords. Therefore, you need to obtain a specific password from the developer's website or developer. Once you know all this information, you can start.

2. Interaction with CVS

1. Import a new project

Set cvsroot Environment Variables
# Export cvsroot =: pserver: cvs@pserver.samba.org:/cvsroot

Log on to the CVS server
# CVS Login
Logging in to: pserver: cvs@pserver.samba.org: 2401/cvsroot
CVS password: (enter the password of the CVS user)

Check the Samba project
# CVS checkout samba

U Samba/copying
U Samba/manifest
U Samba/readme
.......

The folder of the Project will appear in the current directory.
You will also notice that each sub-directory has a "CVS" directory-CVS stores account information in these directories, so you can safely ignore them. Once the check-out is complete, you do not need to worry about setting the cvsroot environment variable or specify it on the command line, because the cache is available in all the additional "CVS" directories.

If you want to add a custom folder to check the project, run the following command:
# CVS checkout-d html samba

The preceding command imports the modified project to the HTML folder.

2. Update source code
After a while, we must update the local source code when we start to modify the project, because someone else may have modified the source code and updated it to the CVS server.
We update the source code before each modification to ensure that the current source code is the latest.

# CVS update

If a directory is added to the server, the preceding command cannot update the directory.
Therefore, use the following command:

# CVS Update-d

3. Submit code
When the file is modified
Run
# CVS commit

In this way, you can synchronize the locally updated files to the server.

Many people say that the CVS download is not found.
Http://sourceforge.net/projects/tortoisecvs/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.