1.3.2. Creating a New Repository


A CVS repository is a central place to store files and directories that are under revision control, as well as additional data such as a complete history of changes or information about who made those changes and when. A typical CVS repository stores multiple projects in separate subdirectories called modules. When publicly accessible, it allows several developers to create a working copy of any of the modules, make changes, and share these changes with others by committing them back to the repository.

Initializing an Empty Repository

To create a new, empty CVS repository in a directory of your choice, run the following command:
cvs -d path init
Note that path must be an absolute path to the directory in which you want to store the repository (for example, /var/cvs/). Alternatively, you can specify this path by changing the value of the $CVSROOT environment variable:
export CVSROOT=path
This allows you to omit the path from cvs init and other CVS-related commands:
cvs init

Example 1.15. Initializing a new CVS repository

To create an empty CVS repository in the ~/cvs/ directory, type:
~]$ export CVSROOT=~/cvs
~]$ cvs init

Importing Data to a Repository

To put an existing project under revision control, change to the directory in which the project is stored and run the following command:
cvs [-d cvs_repository] import [-m "commit message"] module vendor_tag release_tag
Note that cvs_repository is a path to the CVS repository, module is the subdirectory in which you want to import the project (such as project), and vendor_tag and release_tag are vendor and release tags.

Example 1.16. Importing a project to a CVS repository

Imagine that the directory with your project has the following contents:
~]$ ls myproject
AUTHORS  doc  INSTALL  LICENSE  Makefile  README  src  TODO
Also imagine that you have an empty CVS repository in ~/cvs/. To import the project under project in this repository with vendor tag mycompany and release tag init, type:
myproject]$ export CVSROOT=~/cvs
myproject]$ cvs import -m "Initial import." project mycompany init
N project/Makefile
N project/AUTHORS
N project/LICENSE
N project/TODO
N project/INSTALL
...
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.