- Cvs Learnet Cheat Sheet
- Cvs Git Cheat Sheet
- Mysql Cheat Sheet Queries
- Mysql Cheat Sheet Github
- Cvs Commands Cheat Sheet
Initialize CVS Vault # 22 # - # 23 a.user@host$ setenv CVSROOT dirthatholdscvsrepository 24 b.user@host$ cvs init 25 initialize a new repository, only need to do this once on the server that 26 holds cvs. CVSQuickReferenceCard AndrewFord refcards.comTM CVSistheConcurrentVersionsSystem,thedominantopen-source, network-transparentversioncontrolsystem. With a little down time this morning I thought I'd start a simple CVS command line reference page (cheat sheet). I've tried to include the most common CVS command line examples here. Cvs co MyProject Checkout the project named MyProject. Your Ultimate Retailer Clearance-Markdown Cheat Sheet Author: Heather. Microfiber Sheet Sets, as Low as $4.27 at Target. As Low as $0.29 at CVS.
2003-04-30 · in Tech Notes · 597 words
I originally wrote this for a group of students doing a project at theUniversity of Kent; the commands described below should be enough to get youstarted with CVS, and you can refer to the other documentation for moreinformation.
The best resource I've found for CVS is Open Source Development WithCVS, informally 'The CVS Book'. (It'salso available as a real book, but all the important information isthere.) I suggest you have a read through that, since it'll cover thisstuff in far more depth. At the very least, make sure you read AnOverview OfCVS,since that explains in a couple of pages what terms like 'repository'mean. For these instructions, I'm assuming you're working on a sharedUnix-like system; there's nothing to stop you from keeping a workingcopy on your machine and using CVS over ssh to get at the sharedrepository, however (see below). CVS for Windows is available for freefrom Cygwin.
Basic CVS operations
Suppose you have a CVS repository in/usr/local/proj/co508/project/hserver/repos
. To use this directly fromthe machine it's on, you'll need to set your CVSROOT
environmentvariable appropriately; if you're using bash type:
To create a new repository (you won't need to do this unless you want to playwith CVS in a new repository, for instance on your own machine, in which caseyou should set CVSROOT
differently):
To import a tree of files into a new CVS project, first change into thedirectory that you want to import, then do this (projname
should be ashort name for the project, vendortag
will probably be your username;releasetag should probably be start
):
Cvs Learnet Cheat Sheet
Note that this, like many CVS commands, will pop up an editor asking forcomments on the checkin. The default editor will probably be vi; if you don'tlike vi (and I don't blame you), then type something like this to use adifferent editor:
To check out a working copy of project projname
(into a directory calledprojname
):
To get the latest changes from the repository into your copy (it won'toverwrite any files you've modified -- it'll print an M
by yourmodified files):
Cvs Git Cheat Sheet
update will also tell you about any conflicts between your changes and changesother people have made to the repository in the mean time.
To show the differences between your working copy and the repository in'context diff' format (see the cvsbook for more details):
To check ('commit') your changes back into the repository:
To view the CVS log entries:
To add a new file to the project:
Mysql Cheat Sheet Queries
To add a new empty directory to the project:
To remove a file from the project:
(Likewise for a directory; you must remove all the files in it first.)
Renaming files in CVS needs a change to be made by hand in therepository; you probably won't need to do this very often, but theprocedure is described in the cvsbook.
Using CVS over a network link via SSH
To run CVS on your machine, assuming your username is xyz5
, you'llneed to do something like:
then the normal CVS commands will work as they do on the shared machine.You will probably want to set up an ssh keypair so you don't have totype your password for each command.
Quick CVS Cheat Sheet
Actually, I’d love to say that I’ve moved completely to using git instead of CVS, but the truth of the matter is that, for a recent project where I’m just trying to consolidate a whole bunch of admin scripts, organize them under one (managed) roof, and (most importantly) get a bunch of admins on board using it, CVS is really probably the way to go. Besides, there’s no branching and merging going on, all of the development is internal, and for simple stuff like this, CVS is really just fine.
The one thing I used to hate about CVS is that it seemed like every time I switched gears from doing some project not involving it to one that used it heavily, I would have to read the whole manual all over again. One thing that helps me remember things is writing about them, so here’s a cheat sheet full of things that I do either regularly, or occasionally enough to be annoying 😉
For the duration of this post, we’ll work with a project called ‘foobrew’, which lives on a remote CVS server. This isn’t meant to be a total n00b intro to CVS, so I’ll assume you know the basics like how to set your CVS_RSH environment variable, for example.
Checking out a repository, or part of one
If you just want to check out the entire project from a remote CVS server, you’d simply run this command:
cvs -d :ext:username@cvs.yourdomain.com:/cvs foobrew
This will download every single file in the source tree into a directory under the one you ran this command from called ‘foobrew’. One of the projects I’ve imported into CVS has various modules that are worked on by different people. If someone only wants to write code for one module, they can easily check out only one module from the repository. For example, to get the ‘malt’ module from the ‘foobrew’ repository, you could run this command:
cvs -d :ext:username@cvs.yourdomain.com:/cvs malt
Of course, maybe the module hasn’t yet been defined, but you know that there’s a directory called ‘malt’ in your repository, and that’s what you’re interested in. Well, in that case, you just alter the above command a bit:
cvs -d :ext:username@cvs.yourdomain.com:/cvs foobrew/malt
Both of those commands result in a directory being created locally called ‘malt’.
Adding to a repository with ‘cvs add’… or not
You don’t *have* to use ‘cvs add’ to add stuff to a repository, but sometimes it’s the easiest way to do what you need. If you have already checked out the project, and you want to add a file to the project, it’s not enough to just copy the file into the right directory. You have to tell the CVS server that you want the file to be managed using CVS, using ‘cvs add’, and then you have to actually check the file in using ‘cvs commit’. So, once you’ve copied the file into place, you would do this:
cvs add README.txt
Followed by
cvs commit README.txt
If the file you want to add is a binary file, only the syntax of the ‘cvs add’ command changes:
cvs add -kb somefile.bin
Using ‘-kb’ tells the CVS server to treat this a bit differently by *not* putting identification strings in the file that could render the binary file un-runnable the next time you check it out of the repository.
The above assume that you’ve checked out the repository, which you might not want to do. For example, if you have a directory full of code you’d like to add to an existing repository, you can add it without first doing a checkout like this:
cvs -d :ext:username@cvs.yourdomain.com:/cvs import foobrew/mycode bkj start
This will create the ‘mycode’ directory under our top-level project directory on the remote server. The ‘bkj’ and ‘start’ arguments are a vendor tag and release tag, respectively, and are required whether you make use of them or not. The use of these tags is out of the scope of this document, but I’ll write about it in another one later 🙂 In general, if you need to use these tags, start looking at using git ;-P
Another option that might be easy enough is to just check out the top level directory of the project, and then use ‘cvs add’ to add your files. If you only want to check out the top level directory of the project, run this command:
Mysql Cheat Sheet Github
cvs -d :ext:username@cvs.yourdomain.com:/cvs checkout -l foobrew
The ‘modules’ file
Cvs Commands Cheat Sheet
If you want to find out what modules are available, or you want to create a module, you can check out the ‘CVSROOT/modules’ file from any CVS repository, and then inspect it or edit it. Since you’d presumably inspect it before editing it, I’ll show here how to create a simple module:
cvs checkout CVSROOT/modules
cd CVSROOT
- open the ‘modules’ file, and add a line like this to define a module called ‘hops’
hops foobrew/hops
- save the file, and run
cvs commit modules
to commit the change. cd ..
- run
cvs release -d CVSROOT
to release the CVSROOT directory and remove it from your working copy (since it isn’t of general use on a day-to-day basis).
Overriding Credentials
One nice thing about CVS is that you can enforce accountability with it. You can give everyone an account on the CVS server and see who made what changes when. On one project, the code needs to be checked out to a directory where only root has write access. So create a read-only user on the server for that user so they can check out the code. But then what happens if I discover a problem in the working copy of the code? Well, generally you’d just make the edit in place and run ‘cvs commit’, but that’s not going to work in this case because by default, CVS uses the credentials that were used to check out the code, which was done in this case by a read-only user. In this case, I need to provide my *own* credentials on the command line to override the ones that were stored locally during the checkout. This is done just like any other command that requires credentials. I just put this note here to remind myself that this is possible:
cvs -d :ext:username@cvs.yourdomain.com:/cvs commit
Technorati Tags: cvs, development, opensource, coding, scripting, howto, technology, internet, cheatsheet, sysadmin, unix, linux,