替换文件后,TFS 无法签入更改
我正在重写一个同事已经完成了原型版本的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
听起来服务器端有该文件的较新版本。将本地文件复制到某处,然后放弃更改并获取最新版本。然后签出并用本地文件覆盖签出的版本。也许有一种更优雅的方法来做到这一点,但它应该可以工作 - 当然它也会覆盖对服务器端版本所做的任何更改。
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.
由于这个问题,我们刚刚与 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
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...
编辑后的文件不再处于只读状态。
这就是解决方案:
The edited files are no longer with read-only status.
So this is the solution: