I started work on some code locally and used Git (Git Gui and command-line) to manage it. I've now been asked to put the project into TFS "at corporate". I can access TFS remotely using a VPN connection.
The code is, to VS, a single solution with multiple projects. I successfully added the solution to TFS using VS, and it seemed to find all the projects and add their .csproj files and all the code to TFS source control.
Later, when not connected to TFS (VPN off), I made a simple change and committed it to my local Git repository. I have had nothing but frustration attempting to (connect to the VPN and) try to commit the change to TFS.
So far so good.
And I'm right back where I started, except that it says "Connect | {solutionName} (Local)"!
Opening the solution first doesn't help; when I connect to TFS the solution gets closed. Closing and opening VS just has it start in "VS knows about TFS, but you're offline" mode and opening the solution with TFS active makes it switch to the Git provider in (Local) mode.
I am very close to doing the registry hacks to disable the Microsoft Git Provider -- I've done my Git work using Git Gui and the commandline; VS has not been involved.
Am I crazy? I would have thought that "develop locally using Git, connect to TFS to sync with others" was a mainstream use case for VS.
Any assistance would be appreciated. Thanks.
Visual Studio only sees git repositories if the .git folder is used as the store for the git repository. So, we can fake-out VS by using a different folder for the git store.
.git
folder to _git
(.git
dir may be hidden).git
containing just the line gitdir: _git
(make the file via command line: echo gitdir: _git>.git
)_git
to your .gitignore
fileNow when you launch VS it will not see that git repository and will use TFS instead.
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