git Visual Studio 2015 Team Explorer 看不到现有的本地存储库克隆

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32017650/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:16:35  来源:igfitidea点击:

Visual Studio 2015 Team Explorer doesn't see existing local repository clone

gitvisual-studio-2015azure-devopsteam-explorer

提问by PilotBob

I have a Visual Studio online Team Project with a repository. I have been using this with VS 2013 for a while now.

我有一个带有存储库的 Visual Studio 在线团队项目。我已经在 VS 2013 中使用了一段时间。

I installed VS 2015 and connected to Visual Studio online in team explorer and chose the project in question.

我安装了 VS 2015 并在团队资源管理器中在线连接到 Visual Studio 并选择了有问题的项目。

however, under solutions it says:

然而,在解决方案下,它说:

You must clone the repository to open solutions for this project.

您必须克隆存储库才能打开此项目的解决方案。

I did go to settings and edit my global settings to set my repository root correctly. (same location as set in Visual Studio 2013)

我确实转到设置并编辑我的全局设置以正确设置我的存储库根目录。(与 Visual Studio 2013 中设置的位置相同)

But, it is already cloned and on my local machine.

但是,它已经被克隆并在我的本地机器上。

Why isn't VS 2015 Team Explorer seeing the existing repository folder? How can I fix this other than deleting the folder and doing clone again?

为什么 VS 2015 Team Explorer 看不到现有的存储库文件夹?除了删除文件夹并再次进行克隆之外,我该如何解决这个问题?

回答by Edward Thomson

Because Visual Studio 2013 maintains a list of the repositories that it's seen (and their remotes) separately from where VS 2015 stores this information.

因为 Visual Studio 2013 维护它所看到的存储库列表(及其远程),与 VS 2015 存储此信息的位置分开。

Open Team Explorer, go to the Connect page, and in the Local Git Repositories section, click the Add button. Navigate to the repository that you cloned previously.

打开 Team Explorer,转到 Connect 页面,然后在 Local Git Repositories 部分中,单击 Add 按钮。导航到您之前克隆的存储库。

Since you're connected to the server, VS will realize that the repository you just opened is a clone of a repository in your server and enable the TFS functionality.

由于您已连接到服务器,VS 将意识到您刚刚打开的存储库是服务器中存储库的克隆,并启用了 TFS 功能。

回答by user1568891

At least for Visual Studio 2017 and Visual Studio Team Services:

至少对于 Visual Studio 2017 和 Visual Studio Team Services:

If you have several repositories in your Team Foundation Server or VSTS project make sure you are connected to the specific repo your clone is for, not just the project. You can then enter the location at the bottom of the "Connect to Project" dialog or just add it as described in the other answer.

如果您的 Team Foundation Server 或 VSTS 项目中有多个存储库,请确保您已连接到克隆所针对的特定存储库,而不仅仅是项目。然后,您可以在“连接到项目”对话框底部输入位置,或者按照其他答案中的描述添加它。

回答by Ruan

Or just close VS, then navigate to the directory that you have cloned and open the solution in your newer Visual studio.

或者只是关闭 VS,然后导航到您克隆的目录并在较新的 Visual Studio 中打开解决方案。

You will see VS changes "applicationhost.config" file, and then remembers that it was cloned

你会看到VS更改了“applicationhost.config”文件,然后才记得它被克隆了

回答by Oliver Winter

I suddenly had the same problem. VS2015 didn't longer recognize, that one of the local repos is a clone and I should make a new clone to "[ProjName]2"...

我突然遇到了同样的问题。VS2015 不再认识到,本地存储库之一是克隆,我应该为“[ProjName]2”制作一个新克隆...

For me it helped to reconnect to the remote Team Project:

对我来说,它有助于重新连接到远程团队项目:

  1. Open the local repository solution
  2. Go to the connection manager ("Manage Connections")
  3. Uncheck the remote project ("Team Projects")
  4. Close Window by click on Connect
  5. Reopen the Connection Manager
  6. Check the Team Project again and "Connect"
  1. 打开本地仓库解决方案
  2. 转到连接管理器(“管理连接”)
  3. 取消选中远程项目(“团队项目”)
  4. 单击“连接”关闭窗口
  5. 重新打开连接管理器
  6. 再次检查团队项目并“连接”

and everything was fine again!

一切又好起来了!