CVS fast class

xiaoxiao2021-03-06  22

Combined with documents and some online resources, I finally got a half-day, I wrote a very simple "fast" teaching material. hope its good for U.S. Here is my steps and practices. 1. Requirements: root permissions; CVS software, find related rpm, tgz, deb, etc. For its installation, please refer to the CVS own documentation installation. I use SLACKWARE TGZ package, the installed command is #installpkg cvs * .tgz other packages, please refer to the command of the corresponding package management tool. A certain system resource, there must be a certain amount of memory (32M can work very well), to have a certain disk space to see your size and how much. 2, set up the CVS server: establish a cvsroot directory, because here involves the user's permission issues reading and writing in CVSROOT, so a relatively simple method is to create a group, then build a set of accounts belonging to the group, and later read Users who write permissions must belong to this group. Suppose we build a group of CVS, username cvsroot. The commands of the group and the user are below #groupadd CVS #adduser cvsroot, the user-owned directory generated in / home / cvsroot, use cvsroot users to log in, modify / home / cvsroot (cvsroot) permission, assignment People have read and write privileges: $ chmod 771. (Or 770 should also) Note: This part of the job is done according to documentation, there must be no test, I will do this after doing the test, the tutorial Little carefully. If you have this experience, please give me, thank you. Establish a CVS warehouse (still cvsroot users), with the following command: $ cvs -d / home / cvsrootin login as root, modify /etc/inetd.conf and / etc / services, add the following line: In / ETC / ITD.CONF JOUREES - NOWAIT ROOT / USR / BIN / CVS CVS - Allow-Root = / Home / CVSROOT PSERVER Description: The above line is a single line, / usr / bin / cvs should be you The CVS version of the command path, please adjust according to your system. / Home / CVSROOT is the path to the cvsroot you created, and also adjust it according to the contents of the part of the directory above. Add: CVSServer 2401 / TCP Description: Cvsserver is any name, but cannot be retrofitted with the existing service, but also the first item that is modified to /etc/inetd.conf above. Here I use CVS password authentication method, CVS has other authentication methods, I have not tested, if you have experience, please add, thank you.

Adding a user who can use CVS services to CVS group: Modify / etc / group as root, add the username of CVS to the CVS group, such as what I want to let the user Laser and GumpW can use CVS services, then modified / etc / group should have the following line: CVS: X: 105: Laser, GID on your system may not be 105, there is no relationship. Mainly to separate the Laser and Gumpwu to the last colon with a comma. Of course, like the distribution of the RedHat has tools like LinuxConf, do this will be simpler. Heavy inetd makes the modification take effect: #killall -hup inetd This server is set. We will then engage in the client. 3, set the client, if it is Linux (or other * NIX), the client and server software is the same, if it is Win, Mac and other platforms, please go to http://www.loria.fr/cgi-bin/ Molli / Wilma.cgi / REL Looking for the corresponding client software, here I will talk about how to do in Linux (* NIX): set environment variables CVSROOT: $ export cvsroot =: pserver: laser @ THE_SERVER_NAME: / home / cvsroot Attention : The PServer here is a way of access, I set it up to password authentication, so this is a PServer, if your CVS server sets the access mode, then modifies it. Laser is a username that can use the CVS server. Here you can modify it according to your settings. I set up the password files of the system user in this version, that is, the Laser must be a legitimate user on the CVS server, which is of course secure. Question, CVS can be set to have its own users, I will add this content in the later version, or you can also provide some additions, or directly read CVS documents. The_server_name is the name or IP address of the CVS server, filling in your care, / home / cvsroot is your cvsroot directory of your CVS server, modify or ask the administrator according to your CVS server settings. You can put this line in your shell's profile (.bash_profile, .profile, etc.) This will not have to knock a long string command each time. Log in to the CVS server: $ CVS login, this time CVS will ask you a password, please knock in the password you on the CVS server, here is the password of the system user on the CVS server: Passwd: XXXXXXXX successfully logged in to you The home directory establishes a .cvspass file, will not enter the password later. Ok, the client setting is complete, simple. Now the server and client are set, so how to use it, I wrote a simplest (estimate is also the most common) command: First, establish a new CVS project, usually there are some project files In this way we can use the following steps to generate a new CVS project: enter your existing project directory, such as Cvstest:

$ cd cvstest running command: $ cvs import -m "this is a cvstest project" cvstest v_0_0_1 start Description: IMPORT is one of the commands of CVS, indicating an input project file to the CVS warehouse. The string behind the -m parameter is a description text, and write some meaningful things. If you do not add -M parameters, then CVS will automatically run an editor (generally VI, but can change to you by modifying environment variable editor) I like to use the editor.) Let you enter information, cvstest is the project name (actually a warehouse name, which is stored in the warehouse named after this name.) V_0_0_1 is the total mark of this branch. Nothing is used (or is not common.) Start is a tag of the input level of the import logo file, no use. In this way, we have built a CVS warehouse, then we can delete this test item file. Test how to get documents from the warehouse. Here I assume that all clients above have been done. Run the following command: $ CVS Checkout Cvstest Retrieves the source file of the CVSTest project from the warehouse. If you have already done Checkout, then you don't need to re-checkout, just enter the directory of the CVSTest project, update it, you can do it: $ CD CVSTEST $ CVS Update. Or you don't want to update directly, just want to see if there is any updated thing, then: $ cvs status will print a long string status report (you may need to use a command paging like LES, or to one Slowly see in the output file.), There is a status report on each file in the project, similar to this: ========================== ================================================================00 To-Date Working Revision: 1.1.1.1 'Some Date' Repository Revision: 1.2 /Home/cvsroot/cvstest/foo.c ,v sticky tag: (none) Sticky Date: (NONE) Sticky Options: (NONE) The most important It is the Status column, there may be four states here: up-to-date: indicates that the file you want is the latest.

Locally Modified: Indicates that you have modified the file, but have not submitted, your version is new than the warehouse. Needing Patch: Indicates that some buddies have modified the file and have been submitted! Your version is more than the old in the warehouse. Needs Merge: Indicates that you have modified the country's document, but there is a non-known phase and modify this file, and it is also submitted to the warehouse! If you just want to keep the software synchronization (like me), then the above thing is enough. However, if you work together to develop a project, it is not so simple. When you participate in the project, when maintaining the file, you need more commands. For example, you are a developer of a NASDAQ project: 1. You have modified a file, such as change CEO.c, plus a line Program: Printf ("WHERE CAN I Find VC To CHEAT!"); After you finish, you have to submit a modification to the warehouse, with a command: $ cvs commit -m "add a company" CEO.c or is: $ CVS Commit - m "Worry About Money" Let CVS help you check which file needs to be submitted. 2, when I start working, maybe I first: $ cvs status, then I will see: ======================= ===================================================5 CEO.c status: Needing Patch Working Revision: 1.1.1.1 'Some Date' Repository Revision: 1.2 /Home/cvsroot/nastaq/ceo.c ,v sticky tag: (none) Sticky Date: (none) sticky options: (none) I know someone CEO.C, so I: $ cvs update CEO.C or simply: $ cvs update updated the CEO.c file to the latest version, and then work. Then submit it. If you have modified coo.c this day, Puts ("How About ANOTHER KIND OF Bragging?"); And submitted, but at this time I have already $ crs status, that is, I don't know your changes. And I added a line of Printf ("You Must Shamelessly and Seems Knowingness to Act As A Coo"); and silly submitted:

$ cvs commit coO.c At this time, CVS will tell me cvs commit: examing. CVS Server: Up-to-date check failed for 'coo.c' CVS [Server Aborted]: CORRECT ABOVE ERROR FIRST! I know some The shit is submitted in the mouth of my modified document, so I $ cvs update At this time, CVS will report: rcs file: /Home/cvsroot/nasdaq/coo.c ,v retrieving revision 1.1.1.1 Retrieving Revision 1.2 Merging Differences Between 1.1 .1.1 and 1.2 INTO coO.c rcsmerge: warning: conflicits During Merge CVS Update: conflicts found in coo.c c coo.c tells you that there is a version conflict, so I edited coo.c, then I saw it in general files. As like this: ... Printf ("You Must Shameless and Seems Knowingness to Act As a Coo"); <<<<<<< Foo.c ======== ... Puts ("How About Another Kind of Bragging? "); >>>>>>> 1.2 ... then I changed the above: Printf (" You Must Shameless and Seems Knowingness to Act As A Coo "); PUTS (" How About Another Kind of Bragging? "); then $ cvs commit -m" merge "coo.c then there is a new patch to play when you update it. . . This is so recovered until all modifications are completed. However, there are some ways to pay attention to the delete program. If you delete the program PUTS ("to be honest") that you may not use; and I don't want to delete (because I use it), and I don't know directly: $ CVS Update, then my line program is finished, so we should pay attention to all developers' coordination, don't delete things, big deal with #IF 0 #ndif macro confedes. I really want to delete something, it is best to mark a version: $ cvs tag v_0_0_1 You can post and delete this version of this version in your own working directory (Note: Not deleting the warehouse.): $ Cvs Release -d Nasdaq Then you regenerate into a new branch: $ cvs RTAG -B -R v_0_0_1 v_0_0_1_1 NasDAQ then build a branch of v_0_0_1_1 $ cvs checkout -r v_0_0_1_1 NASDAQ edit and modify this branch file, this is better. There are still some commands, such as adding a file GARBAGE_CHINA_CONCEPT_STOCKS_LIST:

$ cvs add garbage_china_concept_stocks_list then: $ cvs commit garbage_china_concert_stocks_list looks a bit like a transaction in the database? It is indeed this. CVS maintains a local reference file (in CVS / ENTRIES) so that all changes can be placed on the server at once, which is safer. Similarly, if you want to delete files Bankrupted_web_site: $ rm Bankrupted_web_site $ cvs remove Bankrupted_web_site $ cvs commit banrupted_web_site is ok, all things, it is estimated that we use commands and contents used in the case of CVS, including file updates, submit, The conflict resolution, the branch derived, and the file, etc. In fact, the power of CVS is powerful, far exceeds the content I described here, I can't manage too much, I hope to use CVS more effectively over time. I also hope that everyone can constantly supplement this article, and finally become a manual, not just a quick. Of course, more references are more referred to. Reference: http://www.loria.fr/cgi-bin/molli/wilma.cgi/doc.865331095.html http://www.loria.fr/~molli/cvs/doc/cvs_toc.html(http : //www.fanqiang.com)

转载请注明原文地址:https://www.9cbs.com/read-39945.html

New Post(0)