TFS: Delete and Rebuild Files, TFS Does not See Adding

advertisements

When I delete and re-add a file in Visual Studio, which is under TFS-SourceControl, if I check in, the TFS only detects the Delete, but not the add. Since we trigger a "Compile"-Check after each checkin, this always triggers an error, since the newly added File is not found, so we have to check-in twice.

Is there a possibility to tell the TFS to mark the deleted/added file not as deleted, but just as changed?


What exactly are you trying to do? If you delete the file, TFS will set the state of the file in source control to "delete pending". It isn't possible to then change the state of the file again to something else without either first checking in the pending change or undoing it. Delete and Add are incompatible pending changes on the same object.

Surely if you are deleting then re-adding a file you are in effect making an edit change, which would be properly tracked in the history. Why not check the file out for edit and assuming the new content is radically different from the original, overwrite the checked out file with the new content and then check it back in.