Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to add files to a checked-in TFS changeset?

I checked in a changeset without all the files actually involved in those changes. (The code checked in compiles, but the ones I missed are "logically connected" -- the checked-in code defines a new interface and a file I missed is one that now implements that interface.)

This was the latest changeset. I have not found any way to add the files; all I can do is check in another changeset with the extra files.

There seems to be no way to add more files when looking at a changeset.

In Git, I could "amend last commit" (or even use the "modify history" mechanisms) but this does not seem possible in TFS.

Is this just another reason to be happier using Git?

like image 732
J.Merrill Avatar asked Feb 04 '15 16:02

J.Merrill


People also ask

How do I edit a changeset in TFS?

Click on the Changeset [number] link for the changset you are interested in. Above the changeset details panel click on the little speech bubble with the plus sign, a textbox will appear and you can enter your comment - hitting Enter will save the comment.

What does check in do TFS?

Checking in a file overwrites the old copy of the file in the source control database with the new one from your local machine. So even if others will not be working on that file, it is a good idea to periodically check in files so that you have a backup in source control.

What is a changeset in TFS?

Changesets contain the history of each item in version control. You can view a changeset to see what the exact file changes were, discover the owner's comments, find linked work items, and see if any policy warnings were triggered.

What does rollback entire changeset do?

Rollback does not delete changesets or any data. If you change your mind, use rollback to revert the content of the files back to their state before the rollback.


2 Answers

No. You cannot do what you want to do. A changeset is a permanent part of the history of your version-controlled items and cannot be undone or removed. You can modify the changeset, but it is restricted to the checkin comment and associated work items.

like image 178
Lukkha Coder Avatar answered Nov 02 '22 05:11

Lukkha Coder


There is a way to combine all your scripts into a new changeset. Here's what you do...

GIVEN:

CS1 = Your original checked in TFS changeset missing a script.

CS2 = A changeset of the rollback of CS1 in TFS

CS3 = Your new TFS changset including the missing script.

STEPS:

1) Rollback CS1

2) Now check in the rollback of CS1...this creates CS2 in TFS

3) Now GetLatest on your project to bring your workspace in sync with TFS

4) Rollback CS2

5) Add the missing script to the other scripts displayed under Pending Changes

6) Check in the complete set of scripts to create CS3

Voi'la

like image 43
MarkInEugene Avatar answered Nov 02 '22 03:11

MarkInEugene