How does visual studio 2013 remember the mapping between a remote git/tfs repository and a local path?
git, tfs, visual-studio-2013
Solution
Detailed description -- so far
The file `%APPDATA%\Microsoft\VisualStudio\12.0\Team Explorer\GitTeamProjects.config` seems to contain this information.
<?xml version="1.0" encoding="utf-8"?>
<!--This file caches information about Git team projects.-->
<collection_list>
<collection guid="9737cdde-596c-43f5-bea7-eadbe664f536" collectionUri="http://tfs:8080/tfs/tahaa" />
<collection guid="d3ee7565-1499-4a84-9eb3-7e97bf3a932e" collectionUri="http://tfs:8080/tfs/test2013">
<project name="_TestBuilds" projectUri="vstfs:///Classification/TeamProject/2706587b-a4b3-4404-a5b1-0e8f210eddc5">
<repository name="SetupConfigurator" guid="54ff434a-bced-4457-8b7c-7f2ab2577514" LastActiveClone="K:\TFS\SetupConfigurator" />
<repository name="Trunk" guid="a08927d7-4e0a-4035-ae5d-964bf03926a4" LastActiveClone="K:\_TestBuilds" />
<repository name="IntegrationTests" guid="37286658-9138-4bab-bc93-9eeb67addd36" LastActiveRepo="Yes" LastActiveClone="K:\GitRepositories\IntegrationTests" />
</project>
</collection>
</collection_list>
I've modified it once, and Visual Studio seems to have lost the mappings then.
But, after having restored it to the original content, Visual Studio doesn't seem to use it again.
I have also found a list of repositories stored in the registry (in `HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\TeamFoundation\GitSourceControl\Repositories`).
Repositories
hash
Name(REG-SZ)
Path(REG-SZ)
hash
Name(REG-SZ)
Path(REG-SZ)
...
Visual Studio 2015
The file name has slightly evolved: `%APPDATA%\Microsoft\VisualStudio\14.0\Team Explorer\TeamExplorer.config`
The registry path has evolved to `HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\TeamFoundation\GitSourceControl\Repositories`
How to refresh the Visual Studio mappings
Let's suppose that all of your git repositories reside in the same folder, on the local machine, and that the path to this folder is K:\GitRepositories
- open Visual Studio 2015
- open the Team Explorer
- press the plug icon
- in the section "Local Git Repositories", click the button Add
- type 'K:\GitRepositories' in the textbox, then 'Add'
Done! Your mappings have been updated.
Problem
How does Visual Studio remember which GIT/TFS (Git over TFS) repository on a given team project has been cloned to the local machine? While browsing the git repositories on a Team Project, Visual Studio shows an icon on the right of the repos which haven't been cloned yet. This icon disappears once the repository has been cloned on the local machine. From this point on, Visual Studio saves a mapping `(remote repository, local path)` somewhere. - Where are these mappings saved? - Is there an API exposing/accessing this information?