简体   繁体   English

VS2015:从差异文件切换到原始文件的快速方法

[英]VS2015: Quick way to switch from diff to original file

Recently we switched to Git and use the integrated Git environment of Visual Studio 2015.最近我们切换到 Git 并使用 Visual Studio 2015 的集成 Git 环境。

If you view changes to a file via the team explorer, it starts comparing the modified one with the original version.如果您通过团队资源管理器查看对文件的更改,它会开始将修改后的版本与原始版本进行比较。 When you're viewing changes in history, you can't modify the file in the diff of course.当您查看历史更改时,您当然不能修改 diff 中的文件。 However, we don't really have a good way of switching to the original file.但是,我们真的没有切换到原始文件的好方法。 We discovered setting a breakpoint works sometimes... But mostly we have to close the file opened for comparison and then navigate to the original file.我们发现设置断点有时会起作用......但大多数情况下我们必须关闭打开的文件进行比较,然后导航到原始文件。 I really have the feeling I'm overlooking something.我真的觉得我忽略了一些东西。

So, is there a quick way to switch from the file diff of Visual Studio to the original file being diffed?那么,有没有一种快速的方法可以从 Visual Studio 的文件差异切换到被差异的原始文件?

PS: I don't know if it's relevant but we're using Resharper. PS:我不知道它是否相关,但我们正在使用 Resharper。

PPS: I'm using Jetbrains Rider for a few years now where I can just press F4 and it opens the original file and places the cursor at the right place as well. PPS:我使用 Jetbrains Rider 已有几年了,我只需按 F4 即可打开原始文件并将光标也放在正确的位置。

您可以使用Shift + Alt + L导航到解决方案资源管理器中的文件,然后按 Enter 打开您正在比较的文件。

Sorry if IDE is not relevant, but for someone it still could be helpful对不起,如果 IDE 不相关,但对于某些人来说它仍然可能会有所帮助

I'm using Visual Studio 2022 and this combination works for me:我正在使用Visual Studio 2022 ,这种组合对我有用:

  1. Ctrl + Alt + L to open Solution Explorer on respective file Ctrl + Alt + L在相应文件上打开Solution Explorer
  2. Enter to open the file输入打开文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM