TFS 中的搁置是什么?

发布于 2024-07-13 09:01:32 字数 67 浏览 5 评论 0原文

在 TFS 中搁置仅仅是一种软签入,以便其他团队成员可以看到源代码吗?

即搁置的代码不会被编译对吗?

Is shelving in TFS merely a soft checkin so other team members can see the source code?

i.e. the shelved code will not be compiled right?

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

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

发布评论

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

评论(8

爱你是孤单的心事 2024-07-20 09:01:33

在这些讨论中,许多讨论中都忽略了一点,那就是如何恢复到搁置更改的同一台计算机上。 也许对大多数人来说是显而易见的,但对我来说却并非如此。 我相信您执行了撤消挂起的更改 - 是这样吗?

我了解该过程如下:

  1. 要搁置当前待处理的更改,请右键单击该项目,搁置,添加搁置名称
  2. 这会将更改保存(或搁置)到服务器(没有人会看到它们)
  3. 然后您可以执行以下 操作:撤消挂起的更改以将代码恢复到最后的签入点
  4. 然后您可以使用恢复的代码基线执行您需要执行的操作
  5. 您可以 随时取消搁置更改(可能需要一些合并冲突)

因此,如果您想开始一些可能需要搁置的工作,请确保在开始之前签入,作为签入点是您在执行上面的“撤消挂起的更改”步骤时将返回的位置。

One point that is missed in a lot of these discussions is how you revert back on the SAME machine on which you shelved your changes. Perhaps obvious to most, but wasn't to me. I believe you perform an Undo Pending Changes - is that right?

I understand the process to be as follows:

  1. To shelve your current pending changes, right click the project, Shelve, add a shelve name
  2. This will save (or Shelve) the changes to the server (no-one will see them)
  3. You then do Undo Pending Changes to revert your code back to the last check-in point
  4. You can then do what you need to do with the reverted code baseline
  5. You can Unshelve the changes at any time (may require some merge confliction)

So, if you want to start some work which you may need to Shelve, make sure you check-in before you start, as the check-in point is where you'll return to when doing the Undo Pending Changes step above.

┈┾☆殇 2024-07-20 09:01:33

我一直遇到这种情况,因此有关分支的补充信息:

如果您正在使用多个分支,则搁置集将与您在其中创建它们的特定分支相关联。 因此,如果您让某个变更集在架子上搁置太久,并且必须将其取消搁置到另一个分支,那么您必须通过 7 月份发布的电动工具来做到这一点。

tfpt unshelve /migrate

I come across this all the time, so supplemental information regarding branches:

If you're working with multiple branches, shelvesets are tied to the specific branch in which you created them. So, if you let a changeset rust on the shelf for too long and have to unshelve to a different branch, then you have to do that with the July release of the power tools.

tfpt unshelve /migrate
爱你不解释 2024-07-20 09:01:33

搁置就像您的更改已存储在源代码管理中,而不影响现有更改。 意味着如果您在源代码管理中签入文件,它将修改现有文件,但搁置就像将更改存储在源代码管理中但不修改实际更改。

Shelving is like your changes have been stored in the source control without affecting the existing changes. Means if you check in a file in source control it will modify the existing file but shelving is like storing your changes in source control but without modifying the actual changes.

土豪我们做朋友吧 2024-07-20 09:01:33

@贾里德帕:
是的,您可以使用搁置集进行评论,但请记住,搁置集可能会被您自己/其他人覆盖,因此并不稳定。 因此,对于与监管相关的审查,您永远不应该使用搁置集作为基础,而应该使用签入(变更集)。
对于非正式审查是可以的,但对于正式(例如 FTA 相关)审查则不行!

@JaredPar:
Yes you can use Shelvesets for reviews but keep in mind that shelvesets can be overwritten by yourself/others and therefore are not long term stable. Therefore for regulatory relevant reviews you should never use a Shelveset as base but rather a checkin (Changeset).
For an informal review it is ok but not for a formal (E.g. FTA relevant) review!

你又不是我 2024-07-20 09:01:33

如果您使用门控构建,则触发构建时,它会创建提交构​​建的工作区的搁置集。 如果构建失败,搁置集将被拒绝。 如果构建成功,则会创建变更集并将其提交到 TFS。 无论哪种情况,执行签入/构建的人员都必须协调工作区,这就像执行“获取最新”一样简单。

If you're using Gated builds, when a build is triggered, it creates a shelveset of your workspace that is submitted for build. If the build fails, the shelveset is rejected. If the build is successful, a changeset is created and committed to TFS. In either event, the person doing that check-in/build will have to reconcile the workspace, which is as simple as performing a Get Latest.

梦里的微风 2024-07-20 09:01:32

货架有很多用途。 主要有:

  1. 上下文切换:保存当前任务的工作,以便您可以切换到另一个高优先级任务。 假设您正在开发一项新功能,只顾自己的事,这时您的老板跑进来说“啊!Bug Bug Bug!” 你必须放弃当前对该功能的更改并修复错误。 您可以搁置对该功能的工作,修复错误,然后返回并取消搁置以稍后处理您的更改。
  2. 共享变更集:如果您想要共享代码变更集而不签入它,您可以通过搁置它来方便其他人访问。 当您将不完整的任务传递给其他人(可怜的灵魂)时,或者如果您有某种测试代码,您永远不会检查其他人需要运行的情况时,可以使用此方法。 h/t 关于使用此进行评论的其他回复,这是一个非常好的主意。
  3. 保存进度:当您正在开发一项复杂的功能时,您可能会发现自己正处于想要保存进度的“最佳时机”。 这是搁置代码的理想时机。 假设您正在修改一些 CSS / HTML 来修复渲染错误。 通常你会不断地敲打它,重复你能想到的每一种可能的组装方式,直到它看起来正确为止。 但是,一旦看起来正确,您可能需要尝试返回清理标记,以便其他人能够理解您在签入之前所做的事情。在这种情况下,当一切都正确呈现时,您可以搁置代码,然后您就可以自由地重构您的标记,并且知道如果您不小心再次破坏它,您可以随时返回并获取您的变更集。

还有其他用途吗?

Shelving has many uses. The main ones are:

  1. Context Switching: Saving the work on your current task so you can switch to another high priority task. Say you're working on a new feature, minding your own business, when your boss runs in and says "Ahhh! Bug Bug Bug!" and you have to drop your current changes on the feature and go fix the bug. You can shelve your work on the feature, fix the bug, then come back and unshelve to work on your changes later.
  2. Sharing Changesets: If you want to share a changeset of code without checking it in, you can make it easy for others to access by shelving it. This could be used when you are passing an incomplete task to someone else (poor soul) or if you have some sort of testing code you would never EVER check in that someone else needed to run. h/t to the other responses about using this for reviews, it is a very good idea.
  3. Saving your progress: While you're working on a complex feature, you may find yourself at a 'good point' where you would like to save your progress. This is an ideal time to shelve your code. Say you are hacking up some CSS / HTML to fix rendering bugs. Usually you bang on it, iterating every possible kludge you can think up until it looks right. However, once it looks right you may want to try and go back in to cleanup your markup so that someone else may be able to understand what you did before you check it in. In this case, you can shelve the code when everything renders right, then you are free to go and refactor your markup, knowing that if you accidentally break it again, you can always go back and get your changeset.

Any other uses?

故事和酒 2024-07-20 09:01:32

搁置是一种无需签入即可保存盒子上所有更改的方法。更改将保留在服务器上。 稍后您或您的任何队友都可以将它们“取消搁置”回您的任何一台机器上。

它也非常适合审查目的。 在我的团队中,我们会搁置更改并发送一封电子邮件,其中包含更改说明和更改集名称。 然后团队中的人员可以查看变更集并提供反馈。

仅供参考:查看搁置集的最佳方法是使用以下命令

tfpt 评论 /shelveset:shelvesetName;用户名

tfpt 是 Team Foundation Power Tools 的一部分

Shelving is a way of saving all of the changes on your box without checking in. The changes are persisted on the server. At any later time you or any of your team-mates can "unshelve" them back onto any one of your machines.

It's also great for review purposes. On my team for a check in we shelve up our changes and send out an email with the change description and name of the changeset. People on the team can then view the changeset and give feedback.

FYI: The best way to review a shelveset is with the following command

tfpt review /shelveset:shelvesetName;userName

tfpt is a part of the Team Foundation Power Tools

最美不过初阳 2024-07-20 09:01:32

这是正确的。 如果您创建一个架子,其他执行获取最新操作的人将看不到您的代码。

它将您的代码更改保存到服务器上,这可能比您的工作 PC 得到更好的备份。

如果您想在家工作,它使您可以在另一台计算机上进行更改。

其他人可以看到您的书架(尽管我认为这可能是可选的),以便他们可以在签入之前查看您的代码。

That's right. If you create a shelf, other people doing a get latest won't see your code.

It puts your code changes onto the server, which is probably better backed up than your work PC.

It enables you to pick up your changes on another machine, should you feel the urge to work from home.

Others can see your shelves (though I think this may be optional) so they can review your code prior to a check-in.

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