Department of Computer Science CVS Tutorial TABLE OF CONTENTS
10 pages
English

Department of Computer Science CVS Tutorial TABLE OF CONTENTS

-

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
10 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description


Department of Computer Science
CVS Tutorial

TABLE OF CONTENTS
What is CVS? __________________________________________________________ 2
CS Department Settings__________________________________________________ 2
Tutorial Settings________________________________________________________ 2
Environmental Variables_________________________________________________ 3
Initial Repository Setup 5
Repository Checkout ____________________________________________________ 6
Adding Files ___________________________________________________________ 7
Removing Files_________________________________________________________ 8
Renaming Files ________________________________________________________ 8
Additional Sources ______________________________________________________ 9
Graphical Interfaces ____________________________________________________ 9
Evaluation ____________________________________________________________ 9
Rev. 10/25/2004
What is CVS?

CVS is a version control system. Using it, you can record the history of your source files.
CS Department Settings

The CS department uses the following settings for all CVS accounts. Note that CVS
accounts use your linux account information for login. Repository information is emailed
to your TXSTATE email account upon creation.

cvs servers: athena.cs.txstate.edu, eros.cs.txstate.edu, hercules.cs.txstate.edu,
zeus.cs.txstate.edu
cvs repository: /home/Students/CVSREP/
account name: ...

Sujets

Informations

Publié par
Nombre de lectures 50
Langue English

Extrait

Department of Computer Science
CVS Tutorial
TABLE OF CONTENTS
What is CVS? __________________________________________________________ 2
CS Department Settings__________________________________________________ 2
Tutorial Settings________________________________________________________ 2
Environmental Variables_________________________________________________ 3
Initial Repository Setup __________________________________________________ 5
Repository Checkout ____________________________________________________ 6
Adding Files ___________________________________________________________ 7
Removing Files_________________________________________________________ 8
Renaming Files ________________________________________________________ 8
Additional Sources______________________________________________________ 9
Graphical Interfaces ____________________________________________________ 9
Evaluation ____________________________________________________________ 9
Rev. 10/25/2004
What is CVS?
CVS is a version control system. Using it, you can record the history of your source files.
CS Department Settings
The CS department uses the following settings for all CVS accounts.
Note that CVS
accounts use your linux account information for login.
Repository information is emailed
to your TXSTATE email account upon creation.
cvs servers: athena.cs.txstate.edu, eros.cs.txstate.edu, hercules.cs.txstate.edu,
zeus.cs.txstate.edu
cvs repository: /home/Students/CVSREP/<repository>
account name: <username>
account auth: <passwd>
Tutorial Settings
The following settings are required for this tutorial.
cvs servers: athena.cs.txstate.edu, eros.cs.txstate.edu, hercules.cs.txstate.edu,
zeus.cs.txstate.edu
cvs repository: /home/Students/CVSREP/tutorial
account name: anonymous
account auth: <>
General Command Structure
cvs [ cvs_options ] cvs_command [ command_options ] [ command_args ]
cvs
The name of the CVS client utility.
Cvs_options
Some options that affect all sub-commands of CVS.
Rev. 02/24/2006
2
Cvs_command
One of several different sub-commands. Some of the commands have aliases that can be
used instead; those aliases are noted in the reference manual for that command. There are
only two situations where you may omit `cvs_command': `cvs -H' elicits a list of available
commands, and `cvs -v' displays version information on CVS itself.
command_options
Options those are specific for the command.
command_args
Arguments to the commands.
Environmental Variables
Below is a list of frequently used environmental variables for CVS. A complete list is
available at
https://www.cvshome.org/docs
. To set an environmental variable from the bash
shell, use the following form at the command prompt:
prompt> export <VARIABLE>=<VALUE>
where <VARIABLE> is the environmental variable you wish to set, and <VALUE> is the
value to set it.
To make this variable available on subsequent logins, add the above line to
your $HOME/.bash_profile file.
CVSIGNORE
A whitespace-separated list of file name patterns that CVS should ignore.
EXAMPLE:
To cause CVS to ignore all object files, the following command could be given:
prompt> export CVSIGNORE="*.o"
CVSROOT
Should contain the full pathname to the root of the CVS source repository. This information
must be available to CVS for most commands to execute.
If this variable is not set, it must
be given on the command line.
The form to use for the CVSROOT value is as follows:
Rev. 02/24/2006
3
:ext:<username>@athena.cs.txstate.edu:<repository>
where :ext tells the server which authentication to use, <username> tells the server who to
authenticate as, @athena.cs.txstate.edu
tells the client where to go, and <repository>
indicates which repository root you want.
EXAMPLE:
If your login name is user0, and you have been assigned the repository /cs1318/hall/group1,
then you could use the following command to set:
prompt> export
CVSROOT=:ext:user0@athena.cs.txstate.edu:/home/Students/CVSREP/cs1318/hall/group1
CVSEDITOR
Specifies the program to use for recording log messages during commit. $CVSEDITOR
overrides $EDITOR, which overrides $VISUAL.
EXAMPLE:
To have CVS invoke the 'vi' editor when needed, use the following command
prompt> export CVSEDITOR=vi
CVS Account Login/Logout
DESCRIPTION:
In order to use your CVS repository, you must first login into the system. You can secure
shell into one of the CS remote access servers like athena, zeus etc.
Edit the .bash_profile in your home directory ( example vi .bash_profile or .jpico
.bash_profile)
Add the following two lines to the end of the file. Make sure to replace the <username>
with your linux username . You can make use of any of the servers athena, zeus etc.
Replace “repo” by your repository name at the end of the path initialized to CVSROOT.
export CVSROOT=:ext:<username>@athena.cs.txstate.edu:/home/Students/CVSREP/repo
export CVS_RSH=ssh
Save and quit.
Rev. 02/24/2006
4
Now you can login back to your linux account and start using the CVS commands from the
command prompt.
EXAMPLE:
prompt> cvs checkout testing
anon@athena.cs.txstate.edu's password:********
cvs checkout: Updating testing
U testing/test.cpp
U testing/test1.cpp
U testing/test2.cpp
U testing/test3.cpp
prompt>
Initial Repository Setup
COMMAND:
cvs import [-options] <repository name> <vendor tag> <release tag>
DESCRIPTION:
Use import to incorporate an entire source distribution from an outside source (e.g., a
source vendor) into your source repository directory. You can use this command both for
initial creation of a repository, and for wholesale updates to the module from the outside
source.
The repository argument gives a directory name (or a path to a directory) under the CVS
root directory for repositories; if the directory did not exist, import creates it.
At least three arguments are required. <repository name> is needed to identify the
collection of source. <vendor tag> is a tag for the entire branch (e.g., for 1.1.1). You must
also specify at least one <release tag> to identify the files at the leaves created each time
you execute import.
Note that import does not change the directory in which you invoke it. In particular, it does
not set up that directory as a CVS working directory; if you want to work with the sources
import them first and then check them out into a different directory.
EXAMPLE:
Rev. 02/24/2006
5
If you want to create a repository containing the source code for helloworld, and it is
located in the directory HelloWorld, you can use the following commands:
prompt> cd HelloWorld
prompt> cvs import -m "Imported sources for helloworld" helloworld user0-tag start
anon@athena.cs.txstate.edu's password:*******
N helloworld/test.c
Unless you supply a log message with the `-m' flag, CVS starts an editor and prompts for a
message. The string 'helloworld' is the repository to create, 'user0-tag' is a vendor tag, and
`start' is a release tag
Repository Checkout
COMMAND:
cvs checkout [options] <module>
DESCRIPTION:
Create or update a working directory containing copies of the source files specified by
modules. You must execute checkout before using most of the other CVS commands, since
most of them operate on your working directory.
Depending on the modules you specify, checkout may recursively create directories and
populate them with the appropriate source files. You can then edit these source files at any
time (regardless of whether other software developers are editing their own copies of the
sources); update them to include new changes applied by others to the source repository; or
commit your work as a permanent change to the source repository.
Note that checkout is used to create directories. The top-level directory created is always
added to the directory where checkout is invoked, and usually has the same name as the
specified module.
EXAMPLE:
If you have imported the project helloworld, and would like to now get a copy of it, do the
following:
prompt> cvs checkout helloworld
Rev. 02/24/2006
6
anon@athena.cs.txstate.edu's password:*******
cvs checkout: Updating helloworld
U helloworld/test.c
Adding Files
COMMAND:
cvs add files...
cvs commit
DESCRIPTION:
Schedule
files
to be added to the repository. The files or directories specified with
add
must
already exist in the current directory. To add a whole new directory hierarchy to the source
repository (for example, files received from a third-party vendor), use the
import
command
instead.
The added files are not placed in the source repository until you use
commit
to make the
change permanent. Doing an
add
on a file that was removed with the
remove
command will
undo the effect of the
remove
, unless a
commit
command intervened.
EXAMPLE:
prompt> touch hello_world.h
prompt> cvs add hello_world.h
ss1475@athena.cs.txstate.edu's password:*******
cvs add: scheduling file `hello_world.h' for addition
cvs add: use 'cvs commit' to add this file permanently
prompt> cvs commit -m"Added header file" hello_world.h
ss1475@athena.cs.txstate.edu's password:*******
RCS file: /home/Students/CVSREP/ctest/helloworld/hello_world.h,v
done
Checking in hello_world.h;
/home/Students/CVSREP/ctest/helloworld/hello_world.h,v
<--
hello_world.h
initial revision: 1.1
Rev. 02/24/2006
7
done
Removing Files
COMMAND:
cvs remove files...
DESCRIPTION:
Schedule file(s) to be removed from the repository (files which have not already been
removed from the working directory are not processed). This command does not actually
remove the file from the repository until you commit the removal.
EXAMPLE:
prompt> cd helloworld
prompt> rm hello_world.h
prompt> cvs remove hello_world.h
prompt> cvs commit
Renaming Files
The normal way to move a file is to copy
old
to
new
, and then issue the normal
CVS
commands to remove
old
from the repository, and add
new
to it.
prompt>
cp old
new
prompt> cvs remove
old
prompt> cvs add
new
prompt> cvs commit -m "Renamed
old
to
new
"
old
new
This is the simplest way to move a file, it is not error-prone, and it preserves the history of
what was done. Note that to access the history of the file you must specify the old or the
new name, depending on what portion of the history you are accessing. For example,
cvs
log
old
will give the log up until the time of the rename.
When
new
is committed its revision numbers will start again, usually at 1.1, so if that
bothers you, use the `
-r rev
' option to commit.
Rev. 02/24/2006
8
Additional Sources
http://www.csc.calpoly.edu/~dbutler/tutorials/winter96/cvs/
http://www.loria.fr/~molli/cvs/cvs-tut/cvs_tutorial_toc.html
https://www.cvshome.org/docs/
Graphical Interfaces
http://www.twobarleycorns.net/tkcvs.html
http://www.smartcvs.com/
Evaluation
The intention of this tutorial is to familiarize the participant with CVS and it’s
commands.
Please leave your comments regarding the tutorial and indicate any areas
improvement you feel should to be made.
Finally, thanks for coming and we hope this tutorial has proved useful and
beneficial.
Comments:
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
Rev. 02/24/2006
9
Rev. 02/24/2006
10
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents