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

查看:22
本文介绍了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. 上下文切换:保存当前任务的工作,以便您可以切换到另一个高优先级任务.假设您正在开发一项新功能,并专注于自己的业务,当您的老板跑进来说啊!Bug Bug Bug!"并且您必须放弃对功能的当前更改并修复错误.您可以搁置对该功能的工作,修复错误,然后再回来并搁置处理您的更改.
  2. 共享变更集:如果您想在不签入的情况下共享代码变更集,您可以将其搁置以方便他人访问.当您将未完成的任务传递给其他人(可怜的人)时,或者如果您有某种测试代码,您永远不会签入其他人需要运行时,可以使用此方法.h/t 其他关于使用此评论的回复,这是一个非常好的主意.
  3. 保存进度:在处理复杂功能时,您可能会发现自己处于好点",想要保存进度.这是搁置代码的理想时机.假设你正在修改一些 CSS/HTML 来修复渲染错误.通常你会敲打它,迭代你能想到的每一个可能的kludge,直到它看起来正确.但是,一旦它看起来正确,您可能想要尝试返回清理您的标记,以便其他人能够在您签入之前了解您所做的事情.在这种情况下,您可以在一切正常时搁置代码,然后您就可以自由地重构您的标记,因为您知道如果您不小心再次破坏它,您可以随时返回并获取您的更改集.
  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天全站免登陆