团队资源管理器在git repo重命名后感到困惑 [英] Team Explorer confused after git repo renaming

查看:80
本文介绍了团队资源管理器在git repo重命名后感到困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我们在重命名一些git存储库后使用VS 2017的团队资源管理器时出现问题。


我们有一个团队项目(让我们称之为"团队项目"),其中我们有2个git存储库:


- MainApp


- AppPrototype


在某些时候,我们决定重命名这些存储库,(通过TFS - >重命名存储库):


- MainApp - > LegacyApp


- AppPrototype - > MainApp



在TFS方面表现不错。


在Visual Studio中,我们可以"重新克隆" MainApp(ex "AppPrototype")通过团队资源管理器>连接>管理连接>克隆,这没问题,我们可以正确使用新的"MainApp"。



但是......


然后我们克隆了OldApp(ex"MainApp")通过团队资源管理器>连接>管理连接>克隆......从那时起,团队资源管理器一团糟!


- 在主要的资源管理器ScreenI上我看到这个(匿名):



即:


- 显示旧存储库名称


- 此处显示AppPrototype(现在称为MainApp)...虽然不再使用该名称调用repo!


- MainApp实际上包含了AppPrototype的内容......即在那部分没问题


- OldApp没有显示...因此我没有使用该代码库时有任何TFS集成(即没有"链接到工作项"等)






怀疑VS中某处存有某种缓存或id ...但这使得现在使用我们的代码库非常痛苦。



什么我们可以吗?







为了清楚起见,在开发人员工作站上,我们在重命名后完成了存储库的完整克隆,以确保我们获得最新的服务器内容。



我们正在使用VS 2017 Update 2(15.2)和TFS 2017 Update 1.

解决方案

来自产品团队:


团队资源管理器确实缓存了该信息,并且重命名服务器上的repo将不会更改其guid。因此,当您连接时,TE会将guid与缓存中的旧名称相匹配。您应该可以通过
来解决此问题:


  1. 断开与相关服务器的连接(连接到某个其他服务器上的某个团队项目或使用团队 - >断开与Team Foundation Server的连接)
  2. 关于在团队资源管理器中连接页面,删除存在MainApp / OldApp等的服务器(选择每个团队项目并按Delete或右键单击 - >删除)
  3. 重新连接打开"连接"对话框(在"连接"页面上管理连接),选择相关的存储库,然后从拆分按钮的下拉菜单中选择"连接"

此时,TE应该缓存新的存储库信息,并且应该将远程存储库与现有的本地克隆进行匹配。


如果这不起作用,您可以尝试完全删除TE缓存,然后重新连接NG。要做到这一点:


  1. 关闭VS的所有实例
  2. 在文件浏览器中打开%appdata%\ Microsoft /\\VisualStudio \15.0_<随机字符串> \Team Explorer \并删除位于其中的TeamExplorer.config文件那里
  3. 重新打开VS并连接到您的存储库。

谢谢!


Hi,

we are having issues using VS 2017's Team Explorer after renaming some git repositories.

We have a Team Project (let's call it "Team Project") in which we had 2 git repositories :

- MainApp

- AppPrototype

At some point, we decided to rename the repositories as such, (via TFS -> Rename repository) :

- MainApp -> LegacyApp

- AppPrototype -> MainApp

It went fine on the TFS side.

In Visual Studio, we could "re-clone" MainApp (ex  "AppPrototype) via Team Explorer > Connect > Manage Connections > Clone, and that went ok, we could properly work with the new "MainApp"

BUT ....

then we cloned OldApp (ex "MainApp") via Team Explorer > Connect > Manage Connections > Clone ... and from that point on, Team Explorer is a mess!

- On the main Team Explorer ScreenI see this (anonymized):

that is :

- the old repository names appear

- AppPrototype (now called MainApp) appears here ... although there is no longer a repo called with that name !

- MainApp actually contains the contents of AppPrototype ... i.e. this is ok on that part

- OldApp does not show up ... and therefore I don't have any TFS integration when working with that codebase (i.e. no "link to work item" etc)

Is suspect there is some kind of cache or id stored somewhere in VS ... but this makes it really painful to work with our codebases right now .

What can we do ?

Just to be clear, on the developer workstations, we did a complete clone of the repositories after the renaming to be sure we get the latest server stuff.

We are using VS 2017 Update 2 (15.2) and TFS 2017 Update 1.

解决方案

From the product team:

Team Explorer does indeed cache that info and renaming the repo on the server will not have changed its guid. Therefore, when you connect, TE will match the guid to the old name in the cache. You should be able to fix this by doing the following:

  1. Disconnect from the server in question (connect to some team project on some other server or use Team -> Disconnect from Team Foundation Server)
  2. On the Connect Page in Team Explorer, remove the server where MainApp/OldApp etc. exists (select each team project and press Delete or right-click->Remove)
  3. Reconnect by opening the Connect Dialog (Manage Connections on the Connect Page), selecting the relevant repositories, and selecting Connect from the drop-down menu on the split button

At this point TE should have the new repository info cached and should match up the remote repositories with the existing local clones.

If that does not work, you can try deleting the TE cache entirely and then reconnecting. To do that:

  1. Close all instances of VS
  2. Open %appdata%\Microsoft\VisualStudio\15.0_<random character string>\Team Explorer\ in a file browser and delete the TeamExplorer.config file located there
  3. Re-open VS and connect to your repositories.

Thanks!


这篇关于团队资源管理器在git repo重命名后感到困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆