什么是工作副本以及“切换”是什么意思? 在 Tortoise SVN 中为我做什么?

发布于 2024-07-14 06:18:10 字数 595 浏览 5 评论 0原文

我有一个软件应用程序,并且已经达到了一个重要的里程碑,即版本 2.0。

我决定将此版本标记为“Version-2.0”,因此我将此快照命名为“Version-2.0”。 我还创建了一个“Version-2.0”分支,以防我需要修复任何内容并将其合并回我的主干中。

阅读 Tortoise SVN 帮助文件后,它告诉我可以将我的“工作副本”切换到新创建的分支。

这是什么意思?

目前,我有:

/项目/主干/
/项目/标签/
/项目/分支机构/

全部签出。 那么“切换”的意义何在呢? 目前,我只是转到我的 /trunk 文件夹并完成我的工作。 当我制作标签和分支时,它在我进行更新后在我的 /Tags/ 和 /Branches/ 文件夹中创建了文件夹。

如果我愿意的话,为什么我不去 /Branches/Experimental-v3.0/ 并在那里做我的工作呢?

有人可以向我解释一下“工作副本”和“切换”的概念吗? 我缺少什么? 人们通常不会检查整个存储库,是吗?

I have a software app and I've hit an important milestone, version 2.0.

I decided I want to tag this version as "Version-2.0" so I have named this snapshot. I also created a "Version-2.0" branch in case I need to fix anything and merge it back into my trunk.

After reading through the Tortoise SVN help file, it informs me that I can switch my "working copy" to a newly created branch.

What does this mean?

Presently, I have:

/Project/Trunk/
/Project/Tags/
/Project/Branches/

All checked out. So what would be the point of "switching"? Currently, I just go to my /trunk folder and do my work. And when I made my tag and branch, it created folders in my /Tags/ and /Branches/ folder after I did an update.

Why wouldn't I just go to /Branches/Experiemental-v3.0/ and do my work there if I wanted to?

Can someone explain the concept of "Working Copy" and "Switching" to me? What am I missing? Do people generally not have the whole repository checked out, is that it?

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

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

发布评论

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

评论(5

陈甜 2024-07-21 06:18:11

工作副本是您签出到工作区域的副本。 无论它是树枝还是树干,都没有关系。 这就是你正在做的事情。

您可以使用 svn switch 在同一父级的分支(或更准确地说是副本)之间进行切换。 这基本上会说明当前工作副本和我要切换到的分支之间有什么不同。 然后,它会将当前工作副本更新为您切换到的分支的修订版本。

因此,工作副本是您的结账,无论它是如何获得的。

切换只是更改您的工作副本提交到的分支。 可以将其想象为更改提交所在的存储库中的指针。 帮助了解从分支机构到您的工作区域的任何差异。

A working copy is the copy you have checked out to your working area. It doesn't matter if it is a branch or from the trunk. It's what you are working on.

You can switch between branches (or more correctly copies) of the same parent with svn switch. This will basically say, what's different between the current working copy and the branch I am switch to. It then performs an update on your current working copy to the revision of branch you switch to.

So working copy is your checkout, however it was obtained.

Switching is just changing the branch your working copy commits to. Think of it like changing the pointer in the repository where your commits will go. With the aid of acquiring any differences from the branch to your work area.

我偏爱纯白色 2024-07-21 06:18:11

通常没有必要签出整个存储库。 subversion 中的分支和标签旨在降低成本 - 即,它们不会创建相同文件的副本,而只是引用它们。
当您签出整个存储库后,当任何人出于任何原因进行分支或标记时,它会突然增加本地硬盘驱动器上使用的空间。

您可以根据需要检出存储库的任意多个部分。 因此,您可以有一个名为“trunk”的文件夹,它是主干的工作副本,另一个“version2”是您分支的工作副本。 这样,创建的任何其他标签都不会被签出。

或者,您可以有一个名为“项目”的结账,如果它最初指向主干,您可以将其切换到一个分支或标签 - 这是重新使用原始结账的一种方式,这样您就不必获取一切都从头再来。

当您正在主干上工作并突然意识到您需要将更改提交到分支时,这样做可能非常有用 - 也许是因为它们太实验性了。 为此,从工作副本分支,切换到新分支然后提交,您的更改将转到分支而不是主干。

It's generally unnecessary to have the whole repository checked out. Branches and tags in subversion are intended to be cheap - ie, they don't create copies of identical files, just reference them.
When you've got the whole repository checked out, when anyone branches or tags for any reason, it's suddenly multiplying the space used on your local hard drive.

You can have as many parts of the repository checked out as you need to. So you could have a folder called 'trunk' which is a working copy of just the trunk, another 'version2' which would be a working copy of your branch. This way, any additional tags which are created don't get checked out.

Or you can have one checkout called 'project', and if it's originally pointing to trunk, you can switch it to one of the branches or tags - it's a way of re-using the original checkout so that you don't have to get everything all over again.

It can be quite useful to do this you're working on trunk and suddenly realise you need to commit your changes to a branch - perhaps because they got too experimental. To do this, branch from your working copy, switch to the new branch then commit and your changes will go to the branch rather than trunk.

如痴如狂 2024-07-21 06:18:11

工作副本是您已签出的代码副本。 通常,您只需查看 /Project/trunk/,而不是存储库的整个结构。 切换是更改工作副本的根目录。 您使用 SVN 的方式并不是它应有的方式。

Working copy is your copy of the code, that you have checked out. Normally, you'd check out just /Project/trunk/, not the whole structure of the repository. Switching is changing your working copy's root. The way you work with SVN is not how it should be done.

猥︴琐丶欲为 2024-07-21 06:18:11

您的工作副本是您硬盘上用于从 subbversion 检出项目的任何文件夹。 您可以为该工作副本“切换”到不同的项目,以便版本控制的内容将类似于该其他项目的内容。

这对于从主干切换到分支很有用,而无需签出新副本。 例如,它可以为您节省一些构建时间,因为未版本控制的文件(您编译的对象、库、可执行文件)不会被删除或更改。

戴夫

Your working copy is any folder on your hard drive that you've used to check out a project from subbversion. You can "switch" to a different project for that working copy, so that the versioned contents will resemble the contents of that other project.

This is useful to switch from trunk to branch, without having to check out a new copy. It can for example save you some build time, since the unversioned files (your compiled objects, libraries, executables) are not removed or changed.

Dave

深海蓝天 2024-07-21 06:18:11

您已经检查了整个项目树 - 这可能不是您想要的。 对于主干工作,请检查以“trunk”为根的副本,而不是从项目根目录。 同样,对于分支工作,仅检查您想要的分支。

You have checked out the whole project tree - this is probably not what you want. For the trunk work, check out a copy rooted at 'trunk', not from the project root. Similarly, for branch work check out only the branch you want.

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