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.
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)
...
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
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
Done! Your mappings have been updated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With