TFS中的货架是什么? [英] What is Shelving in TFS?

查看:123
本文介绍了TFS中的货架是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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?

推荐答案

货架有很多用途.主要的是:

Shelving has many uses. The main ones are:

  1. 上下文切换:保存当前任务的工作,以便您可以切换到另一个高优先级任务.假设您正在开发一项新功能,当您的老板跑来跑去并说"Ahhh!Bug Bug Bug!"时,您将在意自己的生意.并且您必须放弃对该功能的当前更改并修复该错误.您可以搁置该功能的工作,修复该错误,然后返回并搁置以稍后进行更改.
  2. 共享变更集:如果您想共享一个变更集而不签入,则可以通过搁置它使其他人易于访问.当您将不完整的任务传递给其他人(可怜的灵魂)时,或者如果您拥有某种测试代码,则永远不会检查是否需要其他人来运行时,可以使用此方法. h/t 关于使用此评论进行评论的其他回复,这是一个非常好的主意./li>
  3. 保存进度:在处理复杂功能时,您可能会发现自己处于好时机",可以保存进度.这是搁置代码的理想时间.假设您要修改一些CSS/HTML,以修复渲染错误.通常,您会不停地反复尝试,反复尝试所有可能想到的错误,直到看起来正确为止.但是,一旦看起来正确,您可能需要尝试重新整理标记,以便其他人可以在签入之前了解您所做的操作.在这种情况下,可以在所有内容正确显示后搁置代码,那么您可以自由地重构标记,知道如果您不小心再次破坏了标记,则可以随时返回并获取更改集.
  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.

还有其他用途吗?

这篇关于TFS中的货架是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆