TFS can’t check in changes after replacing file

tfs

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?

Best Answer

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.