替换文件后,TFS 无法签入更改

发布于 2024-11-26 16:47:54 字数 430 浏览 4 评论 0原文

我正在重写一个同事已经完成了原型版本的 Asp.Net 项目。我删除了 Default.aspx 并创建了一个新版本,现在我正在尝试签入该新版本。

当我尝试签入待处理的更改时,我得到了标准:

签入,由于更改冲突,没有签入文件。请使用 冲突频道解决冲突并重试。

我被重定向到“待处理的更改 - 冲突”选项卡,其中显示以下选项:“获取服务器版本”“保留本地版本”

如果我点击“保留本地版本”,我会收到以下错误:

错误,遇到以下异常。该项目 $/ProjectName/Default.aspx 已有待更改。

我怎样才能让它接受我的文件的新版本?

I'm re-writing an Asp.Net project that a colleague had done a prototype version of. I deleted the Default.aspx and created and new one and now I'm trying to check that new version in.

When I try to check in pending changes I get the standard:

Check In, No files checked in due to conflicting changes. Please use
Conflicts Channel to resolve conflicts and try again.

I'm re-directed to the Pending Changes - Conflicts tab, where I'm presented with the options: 'Take Server Version' or 'Keep Local Version'.

If I click 'Keep Local Version', I get the following error:

Error, The following exception was encountered. The item
$/ProjectName/Default.aspx already has pending changes.

How can I get it to accept my new version of the file?

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

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

发布评论

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

评论(3

無心 2024-12-03 16:47:54

听起来服务器端有该文件的较新版本。将本地文件复制到某处,然后放弃更改并获取最新版本。然后签出并用本地文件覆盖签出的版本。也许有一种更优雅的方法来做到这一点,但它应该可以工作 - 当然它也会覆盖对服务器端版本所做的任何更改。

Sounds like there's a newer version of that file on the server side. Copy your local file somewhere, then discard your changes and get latest. Then check out and overwrite the checked-out version with your local file. Perhaps there's a more elegant way to do it, but it should work - and of course it will also overwrite any changes made to the server-side version.

猫七 2024-12-03 16:47:54

由于这个问题,我们刚刚与 TFS 斗争了 30 分钟。

一位同事签入了一个文件,我们想回滚到以前的版本。 TFS 会让我们检出该文件,使用历史记录并获取旧版本,但是一旦我们点击“保存”,VS2015 就会立即“取消检出”该文件,恢复到最新版本< /em> TFS 中的文件,我们丢失了更改。没有警告,也没有可能阻止它。

其他时候,我们会进行签入,但 TFS 会抱怨“由于更改冲突,没有签入文件”,并且再次将我们从 TFS 恢复到最新版本,没有任何选项可以阻止这种情况。

最终对我们有用的是

  • 签出文件,将
  • 其内容设置为旧版本(这就是我们想要的),
  • 打开存储它的文件夹并将文件设置为只读
  • 签入 通过这样

做,TFS 不会自动使用 TFS 中的最新代码覆盖我们的文件,并且我们能够签入我们想要的版本。

我需要一杯啤酒...

We've just spent 30 minutes fighting with TFS due to this problem.

A colleague had checked in a file, and we wanted to rollback to a previous version. TFS would let us check-out that file, use History, and get the older version, but as soon as we hit Save, VS2015 would immediately "un-check-out" the file, revert back to the latest version of the file in TFS and we lost our changes. No warnings, no possibilities to prevent it.

Other times, we'd do a Check-in, but TFS would complain "No files checked in due to conflicting changes", and, again, revert us back to the latest version from TFS, with no options to prevent this.

What finally worked for us was to

  • check out the file
  • set it's contents to the older version (which is what we wanted)
  • open the folder where it was stored and set the file to Read-Only
  • check in the file

By doing this, TFS didn't automatically overwrite our file with the latest code from TFS, and we were able to check in the version we wanted to.

I need a beer...

赏烟花じ飞满天 2024-12-03 16:47:54

编辑后的文件不再处于只读状态。
这就是解决方案:

  1. 关闭项目。 (或者使用TfsGoOffline,我喜欢这个,你可以跳过2、3, 4)
  2. 断开互联网连接。
  3. 打开项目,它现在处于离线模式。
  4. 重新连接到互联网。
  5. 右键单击该解决方案并选择“在线”。
  6. VS 将检查所有非“只读”的文件,并将它们视为“已更改”并标记为签出。
  7. 现在所有已替换的文件都已成功检出。

The edited files are no longer with read-only status.
So this is the solution:

  1. Close the project. (Or use TfsGoOffline, I love this, you can skip 2, 3, 4)
  2. Disconnect internet.
  3. Open the project and it will now in offline mode.
  4. Reconnect to the Internet.
  5. Right-click the solution and select "Online".
  6. VS will checks all files that are not "read-only" and treats them as "changed" and mark as check out.
  7. Now all files that have been replaced are successfully checked out.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文