Reputation: 14640
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?
Upvotes: 4
Views: 16725
Reputation: 1177
The edited files are no longer with read-only status.
So this is the solution:
Upvotes: 0
Reputation: 29201
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...
Upvotes: 2
Reputation: 4746
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.
Upvotes: 21