Visual Studio: Change default path for repositories for GIT plugin

GitVisual Studio

Git Problem Overview


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

Snapshot

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

Git Solutions


Solution 1 - Git

In Visual Studio 2015 / 2017 / 2019:

  1. Go to the menu bar, click View and then select Team Explorer
  2. Click the Home icon button in Team Explorer
  3. Click on Settings
  4. Click on Global Settings under Git
    (Note: may not appear if you have no cloned git repos)
  5. Alter the path for the Default location.
  6. Click OK/Update

Note: the location is case-sensitive, and it will not warn you if that exact location is not found

Solution 2 - Git

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

enter image description here

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

> Tools | Options | Projects and Solutions | Locations

enter image description here

Solution 3 - Git

For VS2013 v4+ and 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.

Solution 4 - Git

Easiest way to access this in 2019:

  1. Ctrl+Q to get to quick launch (or click on it at the top of the window)

  2. Type git settings enter image description here

  3. Change Default Location here enter image description here

Solution 5 - Git

I am able to access Git Global Settings from Visual Studio "Tools..." menu rather than from Team Explorer:

[VS2019] => Tools | Options... [Source Control] > Git Global Settings

(I have not tested it with earlier versions of Visual Studio.)

This works even when you have not opened and/or cloned a Git repos.

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSuperJMNView Question on Stackoverflow
Solution 1 - GitDemodaveView Answer on Stackoverflow
Solution 2 - GitDrew NoakesView Answer on Stackoverflow
Solution 3 - GitBikeMrownView Answer on Stackoverflow
Solution 4 - GitDLehView Answer on Stackoverflow
Solution 5 - GitPaul YaoView Answer on Stackoverflow