这是创建具有多个项目和供应商的 SVN 存储库的正确步骤和组织吗?

发布于 2024-07-07 23:29:47 字数 1122 浏览 10 评论 0原文

我已经阅读了相当多的 Red Bean Software SVN Book,以及一些关于 SO 的问题,但我想确保我在第一次之前一步一步地以正确的方式解决这个问题我开始使用它。 它是否正确?

  1. 安装SVN。
  2. 在 /usr/local/svn 创建 SVN 存储库。 目录结构如下所示:

    <前><代码>--conf - D b - 格式 -- 钩子 -- 锁 -- 自述文件.txt
  3. 通过命令行创建文件夹以进行存储库组织(包括项目和供应商)。

    <前><代码>--conf - D b - 格式 -- 钩子 -- 锁 -- 项目 - 项目名 - 小贩 - 树干 -- 分支机构 -- 标签 - 项目名 - 小贩 - 树干 -- 分支机构 -- 标签 -- 自述文件.txt
  4. 将供应商代码签入正确项目名称下的供应商文件夹中。

  5. 将供应商代码导出到正确项目名称下的主干中(无需合并,因为我还没有项目主干文件)。
  6. 在 /svnroot/conf/passwd 和 /svnroot/conf/svnserve.conf 中创建用户/权限。
  7. 确保 svnserve 正在运行,并在我的本地 SVN 客户端 (TortoiseSVN) 上签出我需要的项目的主干。

我不需要通过公共 URL 提供此服务,因此我没有为 Apache 进行配置。 该服务器不在我们的网络中,而是我们租用的专用 CentOS 机器。 感谢您的任何想法和建议。

编辑:

我想我很困惑,因为我没有代码或项目,所以我从供应商的代码开始。 我是否需要在服务器上的某个位置创建一个目录结构,其中包括我的项目名称和供应商、主干、分支和标签子文件夹,将其导入到我的存储库中,然后将代码从供应商导入到供应商文件夹中? 我的想法是,我可以从供应商那里获取更新,然后将这些更新与我对主干所做的任何更改合并。

I've read quite a bit of the Red Bean Software SVN Book, and some of the questions here on SO, but I want to make sure I'm going about this in the right way the first time around step-by-step before I begin using it. Is this correct?

  1. Install SVN.
  2. Create SVN repository at /usr/local/svn. Directory structure looks like this:

    -- conf
    -- db
    -- format
    -- hooks
    -- locks
    -- README.txt
    
  3. Create folders through command line for repository organization (including projects and vendors).

    -- conf
    -- db
    -- format
    -- hooks
    -- locks
    -- projects
       -- project_name
          -- vendor
          -- trunk
          -- branches
          -- tags
       -- project_name
          -- vendor
          -- trunk
          -- branches
          -- tags
    -- README.txt
    
  4. Checkout vendor code into vendor folder under the correct project name.

  5. Export vendor code into trunk under the correct project name (no merge necessary, as I have no project trunk files yet).
  6. Create users/permissions in /svnroot/conf/passwd and /svnroot/conf/svnserve.conf.
  7. Make sure that svnserve is running, and on my local SVN client (TortoiseSVN), checkout the trunk for the project that I need.

I don't need to serve this up by public URL, so I'm not configuring for Apache. The server is not in our network, but is a dedicated CentOS box we rent. Thanks for any thoughts and advice.

EDIT:

I guess I'm confused because I don't have code or a project to begin with, so I am starting fresh from the vendor's code. Do I need to create a directory structure somewhere on the server that includes my project_name w/ vendor, trunk, branches and tags subfolders, import that into my repo, and then import the code from the vendor into the vendor folder? The idea is that I can get updates from the vendor, and then merge those updates with any changes I made to my trunk.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

画骨成沙 2024-07-14 23:29:47

通过命令行创建文件夹用于存储库组织(包括项目和供应商)。

您的意思是通过在 subversion 安装目录中创建目录来创建存储库结构吗? 这是非常错误的。

您必须通过 svn mkdir 命令而不是通过文件系统创建必要的文件夹。

/usr/local/svn 中,您拥有 Subversion 存储库的物理实现,并且您只能通过客户端访问它,而不能“手动”接触它。

例如,使用 file:// URL 方案

svn mkdir file:///usr/local/svn/projects -m "Parent dir for projects created"

Create folders through command line for repository organization (including projects and vendors).

Do you mean creating the repository structure by making directories inside the subversion intallation directory? That's very wrong.

You have to create the necessary folders via the svn mkdir command and not via filesystem.

In /usr/local/svn you have the physical implementation of the Subversion repository, and you must access it only via a client, and never touch it "by hand".

For example, using the file:// URL scheme

svn mkdir file:///usr/local/svn/projects -m "Parent dir for projects created"
故乡的云 2024-07-14 23:29:47

您的想法似乎基本正确,但您的术语有点错误。 这确实会让 SVN 用户感到困惑,因为您使用的单词在 SVN 上下文中具有特定含义。 扩展 Davide 所说的内容:

2)通过执行诸如 svnadmin create /usr/local/svn 之类的操作来创建存储库。

3)创建您的文件夹。 您不需要(或不想要)列表中不低于 projects/ 的部分。 这些其他目录是 SVN 用于跟踪修订的目录,它们实际上并不在存储库中。 如果您在系统上的某个位置创建了包含 project_name/ 子树的目录层次结构,则可以根据需要多次运行 svn import,每个项目运行一次(每次为目的地指定不同的名称)。 这将创建您的目录结构。

4)我认为你的意思不是“签出”,而是“导入”或“签入”(在SVN用语中通常称为“提交”,但可以理解“签入”)。 导入会将供应商文件添加到存储库中。 签出意味着“创建此版本化目录的本地副本供我使用”,称为工作副本。 团队中的每个开发人员都应该有自己的工作副本。 开发人员对其工作副本进行更改后,他们会 svn commit 将更改发送到存储库。 团队中的其他开发人员将运行 svn update 将这些更改从存储库获取到他们自己的工作副本中。

5)我最近没有读过SVN的书,但我认为它指导你将vendor分支的版本复制到主干中,而不是导出它。 用 SVN 术语来说,导出意味着取消目录树的版本,这显然不是您想要的。

如果在第 2 步之后立即执行第 6 步和第 7 步,您可能会发现事情会更容易,因为这样您就可以使用 svn:// 协议来访问您的存储库以执行其余步骤,而不是使用 file: // 按照 Davide 的建议,仅适用于本地计算机。

You seem to have mostly the right idea, but your terminology is a bit wrong. That will really confuse the SVN people, since you're using words that have specific meanings in the context of SVN. To expand on what Davide said:

2) create your repository by doing something like svnadmin create /usr/local/svn.

3) create your folders. You don't need (or want) the parts of your list that aren't below projects/. Those other directories are what SVN uses to keep track of revisions, they're not actually in the repository. If you create a directory hierarchy somewhere on your system that contains the project_name/ subtree, you can then run svn import on it as many times as you want, once for each project (giving a different name for the destination each time). That will create your directory structure.

4) Instead of "checkout", I think you mean either "import" or "checkin" (usually called "commit" in SVN parlance, but "checkin" will be understood). Importing will add the vendor files to the repository. Checkout means "create a local copy of this versioned directory for me to work with" known as a Working Copy. Every developer on your team should have their own working copy. After a developer makes changes to their working copy, they then svn commit them which sends the changes to the repository. The other developers on the team will run svn update to get those changes from the repository into their own working copies.

5) I haven't read the SVN book lately, but I think it instructs you to copy the version of the vendor branch into the trunk, not export it. Exporting in SVN terms means to un-version the directory tree, which is clearly not what you want.

You may find things easier if you do steps 6 and 7 right after step 2, since then you can use the svn:// protocol to access your repository for the remaining steps instead of file:// as suggested by Davide, which only works on the local machine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文