简体   繁体   English

如何在 Visual Studio 2019 中删除本地 git 存储库?

[英]How to remove local git repositories in Visual Studio 2019?

In vs 2017 there was an option under Local Git Repositories -> right click "delete repository".在 vs 2017 中,在本地 Git 存储库下有一个选项 -> 右键单击“删除存储库”。

In vs 2019 there is no menu like that:在 vs 2019 中没有这样的菜单:

有关新 Git 菜单的信息

And in the new menu it seems that there is no option for deleting:在新菜单中似乎没有删除选项: 新的 Git 菜单

Of course I can delete the repositories manually, I am just wondering if there are any way to do it visual studio.当然我可以手动删除存储库,我只是想知道是否有任何方法可以做到这一点。 Thanks for your help!谢谢你的帮助!

I had similar problem in VS2022 / Community edition.我在 VS2022 / 社区版中遇到了类似的问题。 Have an unused branch already renamed, but its original name was still available in menu Git / Local Repositories... Matching that name (entry from the menu) in the project folder, showed me following:已重命名一个未使用的分支,但其原始名称仍可在菜单 Git / Local Repositories... 匹配项目文件夹中的该名称(菜单条目),向我显示以下内容:

  1. Simply try to locate a folder called .vs (usually is hidden) in the root of your git archive folder.只需尝试在 git 存档文件夹的根目录中找到一个名为.vs的文件夹(通常是隐藏的)。
  2. In this folder check for existence of folders having same name as your projects to remove from the menu - usually that folders points to empty directory tree!!在此文件夹中检查是否存在与您的项目同名的文件夹以从菜单中删除 - 通常该文件夹指向空目录树!
  3. in file explorer, better by VS switched off - delete it.在文件资源管理器中,最好通过 VS 关闭 - 删除它。 That approach helped me.这种方法帮助了我。

just delete the.git file in your project directory and then refresh只需删除项目目录下的.git文件然后刷新

if you can't find the.git file in your project it may be如果您在项目中找不到 .git 文件,则可能是

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

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