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.
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
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):
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!
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.
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