此内容没有您所选择的语言版本。

1.2.2. Creating a New Repository


A Subversion 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 Subversion repository stores multiple projects in separate subdirectories. When publicly accessible, it allows several developers to create a working copy of any of the subdirectories, make changes, and share these changes with others by committing them back to the repository.

Initializing an Empty Repository

To create a new, empty Subversion repository in a directory of your choice, run the following command:
svnadmin create path
Note that path is an absolute or relative path to the directory in which you want to store the repository (for example, /var/svn/). If the directory does not exist, svnadmin create creates it for you.

Example 1.4. Initializing a new Subversion repository

To create an empty Subversion repository in the ~/svn/ directory, type:
~]$ svnadmin create svn

Importing Data to a Repository

To put an existing project under revision control, run the following command:
svn import local_path svn_repository/remote_path [-m "commit message"]
Note that local_path is an absolute or relative path to the directory in which you keep the project (use . for the current working directory), svn_repository is a URL of the Subversion repository, and remote_path is the target directory in the Subversion repository (for example, project/trunk).

Example 1.5. Importing a project to a Subversion 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 Subversion repository in ~/svn/ (in this example, /home/john/svn/). To import the project under project/trunk in this repository, type:
~]$ svn import myproject file:///home/john/svn/project/trunk -m "Initial import."
Adding         project/AUTHORS
Adding         project/doc
Adding         project/doc/index.html
Adding         project/INSTALL
Adding         project/src
...
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.