Can TFS Pending Changes show files that are truly changed like SourceGear Vault?

前端 未结 5 1186
长情又很酷
长情又很酷 2021-01-31 03:40

I have been using SourceGear vault for some personal projects and Team Foundation Server for work projects. One thing TFS is missing is a simple feature that Vault has on its ch

相关标签:
5条回答
  • 2021-01-31 04:19

    Per this page, you can run this command from the Visual Studio Command Prompt.

    tfpt uu /noget /r *
    

    You'll need to have TFS Power Tools installed for this to work. Also, make sure you browse to the root of your mapped folder within the command prompt (ie - C:\TFS for example).

    TFS Power Tools links (if you don't already have it)
    TFS Power Tools for 2010
    TFS Power Tools for 2012

    0 讨论(0)
  • 2021-01-31 04:20

    There is no need to undo the unchanged files, as TFS will notice they're unchanged upon checkin and will only associate the truly changed files. Any files checked out but unchanged are reverted to their last known checked in version and will not be associated with your checkin. It is impossible in TFS (though not very clearly documented) to check in an unchanged file. It will always revert to the previous version if there are no changes.

    You can quickly undo your unchanged files by calling 'tfpt.exe uu /r' from the command line (you need to have the Team Foundation Power tools for this) or by using the "Undo unchanged" button in the Pending changes window. This removed any items from the list that are unchanged immediately. So that you can see exactly what you're checking in.

    Undo unchanged option

    Though it might be that this option is added by the Team Foundation Power Tools or the TFS Source Control Explorer Extensions (which are a must have for every TFS user anyways).

    See also:

    • https://stackoverflow.com/a/2100981/736079
    • https://stackoverflow.com/a/6387656/736079
    • https://jessehouwing.net/vsts-tfs-why-i-like-them/
    0 讨论(0)
  • 2021-01-31 04:24

    Select all the files in "Pending changes" window and activate the context menu. Then click "Undo..." > "Undo Changes" > "No to All". The files without changes will be rolled back.

    0 讨论(0)
  • 2021-01-31 04:25

    I don't like answering my own questions, but it looks like there might not be a real Microsoft solution out there. For me, this is how I handle the problem at the office using Visual Studio.

    1. Before I re-generate the business objects, I make a copy of the entire folder structure
    2. I check out the entire project or the root generated folder
    3. I start the code generator. Sometimes, I know exactly what is changing, but other times, I might make a lot of changes and I don't want to miss anything. My code generator at work also generates all the SQL files needed to DROP / CREATE stored procedures.
    4. Using SourceGear DiffMerge, I compare the folders of the just generated and the previously backed up folder.

    This is pretty time consuming. I never thought of it as a problem until I saw Vault identifying that a file was different on disk from the repository.

    Maybe you all can say how you do code generation / regeneration when working with a source control repository.

    0 讨论(0)
  • 2021-01-31 04:36

    I work in a corporate development environment where many developers may be working on the same file, and we have TFS as our source control as well. In our document of Best Practices for TFS, we really discourage checking out files that the developers don't intend on changing, that way we naturally exclude files without differences when submitting a changeset.

    To answer your question, I normally just look at the "Pending Changes" window and run a Compare on the "changed" files that I'm unsure of--the Compare tool should immediately tell you if your local copy is the same as the server copy. Unfortunately, there's no real workaround other than what I suggested, but I don't see the scenario where I absolutely must check out an entire project branch for editing.

    0 讨论(0)
提交回复
热议问题