TFS 2010 和未修改文件的签入

发布于 2024-11-16 02:25:15 字数 117 浏览 1 评论 0原文

是否可以仅签入包含 Team Foundation Server 修改的文件?我的意思是有一个选项可以在某处激活它吗?

当一家外包公司向我们发送了近一百个源代码文件并且我只想签入修改后的文件时,我需要它。

Is it possible to check-in only files that contain modification with Team Foundation Server? I mean is there an option to activate this somewhere?

I need it when an outsourcing company send us almost an hundred source code files and I want to check in only the modified ones.

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

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

发布评论

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

评论(5

清风挽心 2024-11-23 02:25:15

当您执行签入时,Team Foundation Server 将不会接受变更集中未修改的项目,但变更集的其余部分将会成功。如果所有文件均未修改,您将收到错误,并且您的变更集将不会被提交。因此,如果您只是担心您的历史记录因实际上并未更改内容的更改而变得混乱,那么 TFS 将为您解决这个问题。

然而,如果有大量未完成的更改实际上没有编辑,这可能会令人讨厌。如果您只想查看出于代码审查或一般理智目的而实际修改的内容,则 TFS Power Tools 包含 tfpt 命令,该命令具有“撤消未更改”功能将撤消对未修改文件的签出。

undo unchanged 命令具有以下用法:

tfpt uu - Undo unchanged

Undoes redundant pending changes. If the state of an item with a pending
change is the same as on the server, then the change is undone.

Usage: tfpt uu [/changeset:changesetnum] [/recursive] [/noget] [filespec...]

 /changeset             Compare the workspace to item states at the changeset
                        version specified instead of the latest version
 filespec...            Only check the listed filespecs for redundant changes
 /recursive             Check the specified filespecs with full recursion
 /noget                 Do not run get before checking

The /changeset option may not be used with filespecs or /recursive.

例如,以下命令将对 TeamProject 进行递归获取,提供具有冗余更改的文件列表,然后提示用户是否要撤消它们:

tfpt uu C:\TFS\TeamProject /recursive

When you perform a check in, Team Foundation Server will not accept items in your changeset that are unmodified, however the rest of the changeset will succeed. If all files are unmodified, you'll get an error and your changeset will not be committed. So if you're just worried about cluttering your history with changes that didn't actually change the content, then TFS will take care of this for you.

However, it can be obnoxious to have a lot of pending changes that don't actually have edits. If what you want to do is only see what's actually modified for code review or just general sanity purposes, the TFS Power Tools contain the tfpt command, which has an "Undo Unchanged" feature that will undo the check outs on unmodified files.

The undo unchanged command has the following usage:

tfpt uu - Undo unchanged

Undoes redundant pending changes. If the state of an item with a pending
change is the same as on the server, then the change is undone.

Usage: tfpt uu [/changeset:changesetnum] [/recursive] [/noget] [filespec...]

 /changeset             Compare the workspace to item states at the changeset
                        version specified instead of the latest version
 filespec...            Only check the listed filespecs for redundant changes
 /recursive             Check the specified filespecs with full recursion
 /noget                 Do not run get before checking

The /changeset option may not be used with filespecs or /recursive.

For example, the following command will do a recursive get on TeamProject, provide a list of files with redundant changes and then prompt the user if they want to undo them:

tfpt uu C:\TFS\TeamProject /recursive
没有伤那来痛 2024-11-23 02:25:15

TFS 在签入期间忽略未修改的文件。

但是,如果您想在签入之前查看哪些文件未修改,您可以执行以下操作(仔细):

  • 在“待更改”窗口中选择所有文件,
  • 右键单击并撤消待定更改
  • 如果任何文件已被修改,TFS 将询问您是否希望放弃更改。单击全部否

所有未更改文件的锁定将被释放,只将已更改的文件保留在待签入列表中。

但是要非常小心按下哪个按钮!

TFS ignores unmodified files during the checkin.

However, if you want to see what files are unmodifed before you check in, you can do this (carefully):

  • Select all files in the Pending Changes window
  • Right click and Undo Pending Changes
  • If any files have been modified, TFS will ask if you wish to discard your changes. Click No All.

Locks on all unchanged files will be released, leaving only the changed files in your pending checkin list.

But be very very careful which button you press!

肥爪爪 2024-11-23 02:25:15

默认情况下,TFS 只会签入已修改的文件,事实上我认为不可能签入*未*修改的文件。如果您使用未经修改的命令行并且未签入的文件将被记录。

默认情况下会比较校验和以避免上传文件。

By default TFS will only check in files that are modified, in fact I don't think it is possible to check in *un*modified files. If you use the command line unmodified and not checked in files will be recorded.

By default checksums are compared to avoid uploading files.

_蜘蛛 2024-11-23 02:25:15

我不确定是否有办法在 Visual Studio 中执行此操作。您可能想尝试使用 Beyond Compare 之类的工具来比较文件夹以找出哪些文件已更改,然后只需检查这些文件即可。 Beyond Compare 还与 Visual Studio 具有出色的集成。

超越比较

I'm not sure that there's a way to do this within Visual Studio. You might want to try a tool like Beyond Compare to compare the folders to find out which files have changed, then just check out those files. Beyond Compare also has excellent integration with Visual Studio.

Beyond Compare

花桑 2024-11-23 02:25:15

在解决方案资源管理器中,您需要右键单击“文件”或“文件夹”,然后单击“将文件添加到源代码管理”。这是使用 VS 2015。

In Solution Explorer, you need to right click on "file" or "folder", and then click "Add files to source control". This is using VS 2015.

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