Visual Studio:更改 GIT 插件存储库的默认路径

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27134077/
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-09 02:41:38  来源:igfitidea点击:

Visual Studio: Change default path for repositories for GIT plugin

gitvisual-studio

提问by SuperJMN

I want to clone a GitHub repository from Visual Studio and the default path is C:\Users\[User]\Sources\Repos\[NameOfProject].

我想从 Visual Studio 克隆一个 GitHub 存储库,默认路径是C:\Users\[User]\Sources\Repos\[NameOfProject].

Snapshot

快照

How to change it? Every time I create or clone a repo, the path remains the same.

如何改变它?每次我创建或克隆一个 repo 时,路径都保持不变。

回答by Demodave

In Visual Studio 2015 / 2017 / 2019:

在 Visual Studio 2015 / 2017 / 2019 中:

  1. Click The Home Button in Team Explorer
  2. Click on Settings
  3. Click on Global Settings under Git
    (Note: may not appear if you have no cloned git repos)
  4. Alter the Path for the Default Repository Location
  5. Click Update
  1. 单击团队资源管理器中的主页按钮
  2. 点击设置
  3. 点击Git下的Global Settings
    (注意:如果没有克隆git repos可能不会出现)
  4. 更改默认存储库位置的路径
  5. 点击更新

回答by BikeMrown

For VS2013 v4+ and VS2015

对于 VS2013 v4+ 和 VS2015

Click on "Settings" (from either the project Home menu or from the top dropdown menu), then select "Git Settings." You will see a Global Setting of "Default Repository Location" (the one you want). Change it and click Update.

单击“设置”(从项目主菜单或顶部下拉菜单中),然后选择“Git 设置”。您将看到“默认存储库位置”的全局设置(您想要的)。更改它并单击更新。

回答by Drew Noakes

In addition to the Team Explorer's Git settings...

除了团队资源管理器的 Git 设置...

enter image description here

在此处输入图片说明

...you'll likely want to change the default project location:

...您可能想要更改默认项目位置:

Tools | Options | Projects and Solutions | Locations

工具 | 选项 | 项目和解决方案 | 地点

enter image description here

在此处输入图片说明