Subversion:如何处理分支、标签和主干文件夹?

发布于 2024-08-26 01:11:51 字数 360 浏览 10 评论 0原文

首先介绍一下背景:

我是一名设计师/开发人员,决定在个人项目中使用 subversion。我是唯一一个从事这个项目的人。我已经在 Mac 上设置了 Beanstalk 帐户并安装了版本。在本地,我有 MySQL 和 PHP 通过 MAMP 运行。

我在版本中做的第一件事是单击“结帐”按钮。我在本地计算机上选择了 webroot 文件夹,并创建了一个包含三个子文件夹的文件夹:branches、tags、trunk。我不明白该怎么办。我的代码位于 webroot 和一堆子文件夹中,我无法将代码移动到这三个文件夹中的任何一个而不破坏内容。

所以,我的问题是,如何告诉 Versions 我的代码位于 webroot 文件夹中,而不是位于它自己创建的文件夹中?

A little background first:

I'm a designer/developer and decided to use subversion for a personal project. I'm the only one working on this project. I've setup a Beanstalk account and installed Versions on Mac. Locally I have MySQL and PHP running through MAMP.

First thing I did in Versions is click the 'checkout' button. I selected my webroot folder on my local machine and a folder has been created with three subfolders: branches, tags, trunk. I don't understand what to do with this. My code lives in the webroot and a bunch of subfolders and I can't move my code to any of the three folders without breaking things.

So, my question is, how do I tell Versions that my code is in the webroot folder and not in the folder it created itself?

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

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

发布评论

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

评论(3

旧人九事 2024-09-02 01:11:51

当您检查工作副本时,您应该检查“主干”而不是存储库根目录。我不熟悉 Beanstalk,但我想您会分配给您某种存储库 URL,如下所示:

https://www.example.com/repos/will/

您不想查看该 URL,而是想查看

https://www.example.com/repos/will/trunk

进入您的 webroot 目录。有关分支、标签以及 Subversion 存储库传统组织方式的更多信息,请参阅 http://svnbook.red-bean.com/en/1.5/svn.reposadmin.planning.html#svn.reposadmin.projects.chooselayout

When you check out your working copy, you should check out the "trunk" rather than the repository root. I'm not familiar with Beanstalk, but I'd imagine you'd have some sort of repository URL assigned to you, like this:

https://www.example.com/repos/will/

Instead of checking out that URL, you want to check out

https://www.example.com/repos/will/trunk

into your webroot directory. For more information on branches, tags, and about how subversion repositories are conventionally organized, see http://svnbook.red-bean.com/en/1.5/svn.reposadmin.planning.html#svn.reposadmin.projects.chooselayout .

尬尬 2024-09-02 01:11:51

“Checkout”用于将代码从 subversion 抓取到本地计算机。由于您还没有这样做,所以它基本上检查了一个空项目。

您想要做的是“导入”。将您的项目导入到 subversion 中的 /trunk 中。然后,如果需要,或者您想在本地计算机上创建第二个副本,您可以从 /trunk 中签出。

同时,每当您想要保存更改时,您就将它们“提交”到 subversion。

/trunk 旨在用作您的工作代码库。这是您所知道的最新版本(当然,减去了一些错误)。

/branches 旨在用于创建可能需要一段时间的大型功能。在这种情况下,您可能不希望该功能的一堆新代码混合到您的工作代码库中。这可能会给您带来一些问题,因此您可能需要将它们分开。为此,请在 /branches 中为每个功能创建一个子文件夹。

/tags 用于“标记”工作副本,例如代码的测试版或发布版本。 t 标签基本上获取了当时整个代码库的副本。稍后,您可以返回该标签并获取创建该标签时代码库的准确版本。就像 /branches 一样,您需要为标签创建子文件夹。

"Checkout" is used to grab code from subversion to your local machine. Since you had not done that yet, it basically checked out an empty project.

What you want to do is "Import". Import your project into /trunk in subversion. Then, you can checkout from /trunk if you ever need to, or if you want to create a second copy on your local machine.

In the meantime, whenever you want to save changes, you "commit" them to subversion.

/trunk is meant to be used as your working codebase. It is the most current version of what you know to be working (minus some bugs, of course).

/branches are meant to be used to create large features that may take a while. In this case, you may not want a bunch of new code for that feature getting mixed into your working codebase. This may cause some problems for you, so you may want to keep them separate. To do this, create a subfolder in /branches for each feature.

/tags are used for "tagging" working copies such as a beta or a release version of your code. A t tag basically takes a copy of the entire codebase at that time. Later on, you can come back to that tag and get an exact version of your codebase when that tag was created. Just like with /branches, you will want to create subfolders for tags.

柏拉图鍀咏恒 2024-09-02 01:11:51

根据您的描述,您似乎没有设置存储库。您可能想阅读一些有关 Subversion 的文章...没有任何 GUI 可以帮助您做好正确使用的准备。这是免费书籍的链接:http://svnbook.red-bean.com/ 和特别是,这是导入文件的参考: http: //svnbook.red-bean.com/en/1.5/svn.tour.importing.html

Based on your description, it doesn't look like you have set up your repository. You might want to do some reading on Subversion...no GUI will prepare you for proper use. Here's a link to a free book: http://svnbook.red-bean.com/ and in particular, this is a reference to importing your files: http://svnbook.red-bean.com/en/1.5/svn.tour.importing.html

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