How to remove a specific changeset in tfs2010?
I have changeset version numbers with 545, 544, 543,542.
Now, I am looking to delete the particular changeset 543 only in tfs?
Find the changeset you want and "Get This Version" to only get the changed files. Manually check out each file for edit in Source Control Explorer to match the changeset.
click the CODE link at the top of the page. you should be in the Explorer tab under your project, in the tree view navigate and select the specific branch you are interested in. click the Changesets link at the top of the page to bring up the changesets for that branch.
Hi, You can do "tfpt rollback" which will pend the necessary changes. If you want the rollback to be committed by a different service/person than the service/person who runs tfpt, have it/them shelve the changes first.
You have to Rollback the changeset, you can't delete a changeset. (Rollback Command)
In your case a simple Rollback command would be like this:
TF rollback /changeset:C543
You cannot delete a changeset in TFS. Even if you could somehow, (I think you can run a sql query against the TFS database to do that) its not a good practice. If people start deleting changesets/history the whole purpose of version control will be defeated. I think few other source controls allow that but I would not suggest to do that. Its a bad practice.
Also, if you use other features of TFS like Workitems/Test Cases
etc. changesets get linked to it so if they get deleted the links will become orphan(I think).
As Arin said the closest thing you can do is to use Rollback command but when you do that you will have to check-in the code after rollback so basically you will see the old changset and the new one(rollback) in the history.
Disclaimer - you should never, never do this. Don't even think about it!
Background - I am trying to do a partial TFS migration, and having the most villainous time with the "TFS Integration" tool. Recently it dumped a series of wrong changesets into my destination TFS. Instead of wiping everything out and starting from scratch, I nosed around the TFS database, and came up with the following (on TFS 2013, TFS 2010 would be more or less similar I suppose):
declare @ChangeSetId int = 5735
-- Delete the actual file content first
delete from tbl_Content where ResourceId in (select ResourceId from tbl_File where FileId in (select FileId from tbl_Version where VersionFrom = @ChangeSetId))
-- Remove the file
delete from tbl_File where FileId in (select FileId from tbl_Version where VersionFrom = @ChangeSetId)
-- Purge the version
delete from tbl_Version where VersionFrom = @ChangeSetId
-- Destroy the changeset
delete from tbl_ChangeSet where ChangeSetId = @ChangeSetId
It is not wise to do it. It is not supported by Microsoft. Do not use it on a live production environment! Use rollback instead! But if you're desperate to wipe out a changeset, you can try this. But don't tell me you were not warned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With