如何暂时安全地忽略 TFS 中的文件/更改

发布于 2024-12-01 15:13:54 字数 529 浏览 3 评论 0原文

在我工作的地方,我们有一个漫长的构建过程,其中包括十几个模块。我在模块 [A] 中工作,经常发生代码在签入模块 [B] 和 [C] 的同时也被签入模块 [A] 的情况(当开发人员处理跨模块项目时会发生这种情况) )。

问题是我定期获取模块的最新信息(出于与开发数据库模式问题相关的其他原因,这是必要的),并且新代码可以引用其他模块([B]、[C] 等)中的代码,而这些模块还没有在我们的日常构建中尚未构建。我可以拉下模块 [B] 和 [C] 并自己构建它们,但由于我们的构建过程中涉及的配置......这可能需要几个小时。

到目前为止,我的解决方案是注释掉包含尚不可用的功能的代码,然后尝试记住在完成工作后不要检查这些注释。有没有办法将文件签出(或一系列文件签出)标记为临时?

简短版本

如何标记部分更改,以便在我签入时这些更改(而不是其余更改)被忽略/撤消?

--编辑

由于涉及我们的开发数据库和自制 ORM 的同步问题,我无法使用分支。

Where I work we have a long build process that includes more than a dozen modules. I work in module [A], and it often happens that code is checked into module [A] at the same time as code is checked into module [B] and [C] (this happens when a developer is working on cross module items).

The problem is that I periodically get latest on my module (necessary for other reasons relating to dev database schema concerns) and the new code can reference code in other modules ([B], [C], et..) which hasn't been built yet in our daily build. I can pull down modules [B] and [C] and build them myself, but due to the configuration involved in our build process...this could take hours.

My solution so far has been to comment out the code which contains the functionality that isn't yet available, and then try to remember not to check those comments in when I am done with my work. Is there a way to mark a file checkout (or a series of file checkouts) as temporary?

Short Version

How do I mark part of my changes so that when I go to check-in that those changes (and not the rest of my changes) are ignored / undone?

--Edit

I can't use branching because of sync issues involving our dev database and our home brewed ORM.

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

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

发布评论

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

评论(3

音栖息无 2024-12-08 15:13:54

简短的回答:不。抱歉。

作为提示,听起来您需要考虑您的分支策略。您可能最好为您的工作创建一个分支,以便您可以单独工作,然后在工作完成时将更改合并回主分支。只需记住在构建过程完成后定期从主分支拉取,以便您的最终合并相对轻松。

Short answer: No. Sorry.

As a tip it sounds like you need to consider your branching strategy. You may be best off creating a branch for your work so that you can work in isolation and then merge back your changes into the main branch when your work is complete. Just remember to pull from main branch regularly after the build process completes so that your final merge is relatively pain free.

冷清清 2024-12-08 15:13:54

我找到的答案是使用名为“隐藏”的 TFS 功能。我可以隐藏包含违规代码的文件夹,然后我就不会错误地签入我试图忽略的代码更改。这仍然有点麻烦,因为我需要确保在完成后关闭隐藏功能,但至少我不会意外删除好的代码。

The answer I found was to use a TFS feature called cloaking. I can cloak a folder containing the offending code, and then I won't mistakenly check in code changes that I am trying to ignore. It is still somewhat cumbersome in that I need to make sure to turn off cloaking once I am done, but at least I wont be erasing good code on accident.

勿忘心安 2024-12-08 15:13:54

这不是 TFS Shelvesets是为了?您可以将所有更改放入搁置集中以便稍后提交,然后按现状处理现有代码。

如果您尚未准备好完全提交更改,则搁置集是等待更改的好方法。

Isn't this what TFS Shelvesets are for? You can put all your changes into a shelveset to be commited later, then work on the existing code as things stand.

Shelvesets are a good way to have your changes waiting if you aren't ready to fully commit them yet.

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