Visual Studio Diff Tool - When is Editing Allowed?

痞子三分冷 提交于 2019-12-04 00:29:12

问题


I'm using Visual Studio 2013 and tfs 2013. Sometimes I'll make a code change and click compare with latest version. The diff tool will open and allows me to edit the file in the diff tool. However other times it will not let me edit but will read only.

Is there some setting or something I need to do for me always allow edit?

In a database project I've noticed that it never lets me edit in the diff tool. Is there some setting I need to change?

I've searched around online but haven't found any answers to this. Thank you.


回答1:


Editing in the Diff viewer is only allowed for certain file types. It doesn't support editing .sql files and there is no VS setting to allow that.

Visual Studio Diff Window: How to Edit .sql Files




回答2:


Have you tried other diff tools like WinMerge or Beyond Compare?

In Visual Studio, go

  • Tools-->Options-->Visual Studio Team Foundation Server-->Configure User Tools,

  • add the extensions of the file types you would like to compare and under Command,

  • input the path of the diff tool (in my case it is Beyond Compare)




回答3:


Other answers are correct as well but do not cover all the cases.

Visual studio will not allow you to edit file during compare if the panel you are trying to edit does not correspond directly to the file in your working directory.

You can easily tell by the address bar on top of the compare panel. If it ends with HEAD or Index - you will not be able to edit the file.



来源:https://stackoverflow.com/questions/30046067/visual-studio-diff-tool-when-is-editing-allowed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!