Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2010 and the check-in of non-modified files

Is it possible to check-in only files that contain modification with Team Foundation Server? I mean is there an option to activate this somewhere?

I need it when an outsourcing company send us almost an hundred source code files and I want to check in only the modified ones.

like image 896
abenci Avatar asked Jun 17 '11 14:06

abenci


3 Answers

When you perform a check in, Team Foundation Server will not accept items in your changeset that are unmodified, however the rest of the changeset will succeed. If all files are unmodified, you'll get an error and your changeset will not be committed. So if you're just worried about cluttering your history with changes that didn't actually change the content, then TFS will take care of this for you.

However, it can be obnoxious to have a lot of pending changes that don't actually have edits. If what you want to do is only see what's actually modified for code review or just general sanity purposes, the TFS Power Tools contain the tfpt command, which has an "Undo Unchanged" feature that will undo the check outs on unmodified files.

The undo unchanged command has the following usage:

tfpt uu - Undo unchanged

Undoes redundant pending changes. If the state of an item with a pending
change is the same as on the server, then the change is undone.

Usage: tfpt uu [/changeset:changesetnum] [/recursive] [/noget] [filespec...]

 /changeset             Compare the workspace to item states at the changeset
                        version specified instead of the latest version
 filespec...            Only check the listed filespecs for redundant changes
 /recursive             Check the specified filespecs with full recursion
 /noget                 Do not run get before checking

The /changeset option may not be used with filespecs or /recursive.

For example, the following command will do a recursive get on TeamProject, provide a list of files with redundant changes and then prompt the user if they want to undo them:

tfpt uu C:\TFS\TeamProject /recursive
like image 55
Edward Thomson Avatar answered Oct 17 '22 05:10

Edward Thomson


TFS ignores unmodified files during the checkin.

However, if you want to see what files are unmodifed before you check in, you can do this (carefully):

  • Select all files in the Pending Changes window
  • Right click and Undo Pending Changes
  • If any files have been modified, TFS will ask if you wish to discard your changes. Click No All.

Locks on all unchanged files will be released, leaving only the changed files in your pending checkin list.

But be very very careful which button you press!

like image 41
Jason Williams Avatar answered Oct 17 '22 04:10

Jason Williams


By default TFS will only check in files that are modified, in fact I don't think it is possible to check in *un*modified files. If you use the command line unmodified and not checked in files will be recorded.

By default checksums are compared to avoid uploading files.

like image 22
Richard Avatar answered Oct 17 '22 04:10

Richard