简体   繁体   English

Visual Studio 2015 Update 2团队资源管理器缺少“排除”

[英]Visual Studio 2015 Update 2 Team Explorer Missing 'Exclude'

I have been using the Git integration from within the Team Explorer section in Visual Studio 2015. 我一直在Visual Studio 2015的Team Explorer部分中使用Git集成。

I have an number of config files in my solution that require modifications in order for the application to run locally but I don't want to commit those changes. 我的解决方案中有许多配置文件需要修改才能使应用程序在本地运行但我不想提交这些更改。

In VS2015 Update 1 there was an 'exclude' option in the 'Changes' section of the Git integration that I could select the modified config files and exclude them from the set of changes. 在VS2015 Update 1中,Git集成的“更改”部分中有一个“排除”选项,我可以选择修改后的配置文件并将其从更改集中排除。 Those files would then not appear in the list of modified files going forward so they stayed excluded for future commits. 然后,这些文件将不会出现在未来修改文件列表中,因此它们将在未来的提交中保留。

Yesterday I installed Update 2 and now that exclude option has gone. 昨天我安装了Update 2,现在排除选项已经消失了。 I can't even see an 'ignore' so now I have to manually select the modified files and stage them each time which is now an extra step and has potential for me committing the local config changes by accident. 我甚至看不到'忽略'所以现在我必须手动选择修改后的文件并每次进行分段,现在这是一个额外的步骤,并且有可能让我意外地提交本地配置更改。 I realise that having a staging area for the files about to be committed is the norm but the default for VS is to just commit everything. 我意识到,为即将提交的文件设置暂存区域是常态,但VS的默认设置是提交所有内容。 If I want to exclude the config files then I need to stage the other files and then commit. 如果我想排除配置文件,那么我需要暂存其他文件,然后提交。

Is there a way of getting back the previous functionality with the exclude option or failing that of ignoring the config files within the VS Git integration. 有没有办法使用exclude选项取回以前的功能,或者无法忽略VS Git集成中的配置文件。 I don't really want to add the config files to the Git ignore list because sometimes I do change those files legitimately and want to commit them. 我真的不想将配置文件添加到Git忽略列表中,因为有时我会合法地更改这些文件并想要提交它们。

Visual Studio now follows the Git terminology instead of the TFS source control Include/Exclude. Visual Studio现在遵循Git术语而不是TFS源控件Include / Exclude。 In Git your changes are un-staged by default. 在Git中,默认情况下您的更改不会暂停。 From now on that's the case in VS too, and you can right click on the files you want to gather for the next commit and select "Stage". 从现在开始,VS也是如此,您可以右键单击要为下次提交收集的文件,然后选择“Stage”。 Once you staged some files, you can commit these staged files exclusively by Commit Staged button (the caption changes from Commit All after you stage at least one file). 一旦您暂存了某些文件,您就可以通过Commit Staged按钮专门提交这些暂存文件(在您至少暂存一个文件后,标题将从Commit All更改)。

As a shortcut however, when you want to commit every changed files at once - and all of them are unstaged initially - you can stage and commit them with one click with Commit All button. 但是,作为一种快捷方式,当您想要一次提交每个已更改的文件时 - 并且所有这些文件最初都是非暂存的 - 您只需单击“ Commit All按钮即可暂存和提交它们。

First this surprised me. 首先这让我感到惊讶。 But knowing the Git terminology it totally make sense. 但是了解Git术语完全有道理。 Include/Exclude comes form the original TFS source control mechanisms, it served similar purpose, but it could have been confusing for those who where new to VS but knew Git. Include / Exclude来自原始的TFS源代码控制机制,它具有类似的用途,但对于VS新手但知道Git的人来说可能会让人感到困惑。

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

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