w3reference home
CVS Tutorial


Bookmark and Share

Checkout Command

The checkout command creates or updates the current working directory with copies of source files from the repository. You need to specify the module in the repository from which you require files. Suppose you are working on a project and want a copy of a file to edit it, you can copy that file from the repository into your working directory. The syntax for using the checkout command is given below:
cvs checkout module
Some points to note
  • Ideally, the checkout command should be used only once on a file. After that, you should use update command to get an updated copy of that file.
  • By default, all files created have read-write attributes. To change the file attributes, you need to specify the –r command option.
  • The top-level mirror directory is created in the directory where checkout command is invoked and has the same name as the mirrored module.
Let's have a look at an example. Suppose we have our project named, "LearnCvs" in our repository and we want to copy it in our working directory. First, we will enter our working directory by using the cd (change directory) command. And then we will use the checkout command given below:
cvs checkout test/basics/LearnCvs
In the above example, "test/basics/LearnCvs" is the complete path of the repository. A directory with the same name "LearnCvs" will be created in the current directory means the directory in which we invoked the above command, having all the files and sub-directories in the project, "LeanrCvs".

Options of the checkout command
1) -D date
Uses the latest version of the file not later than the date. There are various ways to specify date many of which are given below:
    2 months ago
    2 hours ago
    8000 seconds ago
    last year
    last Tuesday
    yesterday
    a fortnight ago
    3/31/92 10:00:07 PST (the format is month/date/year)
    February 28, 1990 01:00pm
    20:00 GMT
Here, the date is a sticky option. Look at the example given below:

cvs checkout -D last Wednesday test/basics/LearnCvs
2) -r tag
Revision tag is implemented.
3) -f
It retrieves the most recent version of the file instead of ignoring it, if the specified version of the file is not found. It is used mostly with the -D date option or the -r tag option.
4) -l
This option causes the checkout command to only copy the specified file or directory and not it's sub-directories.
5) -P
This option tells the checkout command to avoid copying any empty directory or empty sub-directory.
6) -p
The file is copied to the console only. It will not be saved to the disk.
7) -R
The directory will be copied along with all the files and sub-directories within it.
8) -n
Disables the checkout command for that file or directory.
9) -k kflag
It is a sticky option that processes the processes the keywords according to the kflag. Updates to this file in the working directory will use kflag.
10) -A
Resets any sticky keys, dates or ktags option.
11) -c
Copies the files in the specified folder in a sorted order to the console and not to the disk.
12) -d dir
This option creates a new working directory with the name dir instead of the default name of the directory in the repository.
Code Validator
Learn FTP
Color finder
Link Checker
Free web designs
Coming soon!
Interview Questions...
'w3reference : Learn by examples ... Advanced to beginner's tutorials ...'
Ajax: AJAX tutorial1 | Apache: Apache HTTP Server | Restarting Apache | CSS: CSS Border | CSS Syntax | CSS Selector | CSS Comment | CVS: CVS Release | CVS Login | CVS Logout | CVS Annotate | Databases: Rolap Tutorial | OLAP Tutorial | OLTP Tutorial | data warehousing | Expect: HTML: html | Linux: Dot (.) conf files | Linux Mount Point | Linux Filesystem | SSH Tutorial | Linux Commands: cal | cat | cfdisk | chroot | MySQL: MySQL Commands | PHP: PHP Basics | PHP Variables | PHP Output (echo/print) | PHP String Concat | PL/SQL: PL/SQL Data Types | PL/SQL Control Structures | PL/SQL File Extensions | PL/SQL DBMS_OUTPUT package | Python: My first Python program | Shell: Starting Bash | Bash Redirection | Bash Pipes | Bash Variables | SQL: SQL Transactions | SQL Constraints | SQL Drop | SQL Union & Union All | SVN: svn architecture | SVN Repository | SVN Import | SVN Checkout | Tech: soap | Web Designing: Web Hosting | HTML/XHTML/CSS code validator | Learn FTP | Search Engine Optimization Tips | www: XML: XML vs HTML | XML Syntax | XML Tags, Elements and Attributes | XML Namespaces |
Sitemap | Disclaim | Privacy Policy | Contact | ©2007-2009 w3reference.com All Rights Reserved.