TFS Shortcut to do a diff on all modified files wi

2019-01-26 05:02发布

I'm looking for a way to kick off a diff on multiple files very easily.

I find it very tedious to have to:

  • Right click on every file
  • Click compare
  • Click with work space version.
  • Rinse and repeat for every file in my change set

Ideally, I'd like to be able to highlight all of the files in my change set, and perform one quick action that launched multiple windows of a diff tool, or launches them one after the other.

It's it's probably good to know that my question is very similar to this question but I'm looking for a way to do this in bulk.

标签: tfs
6条回答
我只想做你的唯一
2楼-- · 2019-01-26 05:15

There is a Visual Studio extension called Diff All Files for VS2015 that does almost exactly what the OP wants. It has the advantage of not requiring you to drop down to a shell to execute it. (There also appears to be versions for VS 2012 and VS 2013.)

To install:

  1. Select Tools -> Extensions and Updates...
  2. Select "Online"
  3. Enter "Diff All Files for VS2015" in the search box.
  4. Select the "Diff All Files for VS2015" extension and install.

It adds a section to the Pending Changes panel in Team Explorer.

查看更多
看我几分像从前
3楼-- · 2019-01-26 05:15

Seems there is no good way to do this. We have to compare the parent folder of multi files, and in the "folder difference" pane, double click each file to check the file changes.

查看更多
可以哭但决不认输i
4楼-- · 2019-01-26 05:15

Under Windows PowerShell, change working directory to the root of your workspace and then run tfpt review. It will then bring up a window listing all pending changes with a check box for each. Double click on a file and a diff will popup, checking the box to let you know it has been reviewed (which is the important part for me. Keeping track of what I have reviewed and what I haven't)

查看更多
太酷不给撩
5楼-- · 2019-01-26 05:18

Use the Tf Command Line Utility. It comes with Visual Studio. You'll have a special command prompt with the tools loaded called "Visual Studio Command Prompt (2010)" in the Start Menu. You should cd to the root directory for the solution. This way you don't have to provide the commands with a servername, credentials, or workspace information. It will pick it up automatically.

I ran the difference command. Without any parameters, it automatically shows the diff for every pending change.

D:\my-project> tf diff

As you close the diff window, the next change will pop up.

查看更多
再贱就再见
6楼-- · 2019-01-26 05:29

I have two additions to Anthony Mastrean's answer. I'd write them as a comment if I had 50 rep :-/

  1. In VS2017 all diffs are opened in tabs.
  2. If you want to diff all modified files in the current folder and its subfolders use tf diff . /recursive
查看更多
做个烂人
7楼-- · 2019-01-26 05:30

It's a bit of overkill just to solve this problem but maybe look at git2tfs, this might allow you a better workflow to get around these issues and free you from some of the other burdens of tfs (eg. readonly files)

查看更多
登录 后发表回答