#MyGitJourney – Opening a Local Repo in Visual Studio That Was Previously Cloned Using the CLI Tools

I have a team project in VSTS using VS Git, that has some stuff in it. I’ve already created a local repo on my desktop using the CLI tools for Git. I’m ready to do some stuff using Visual Studio in my local repository. And I also want to make sure I’m connected up to my team project in VSTS as well.

Attempt #1 – Connecting To Local Repo/Team Project

I open Visual Studio 2017, and select the Team Explorer tab. Click the Manage Connections button.

Click the Manage Connections drop down and select Connect to a Project

I’m going to select the VSTSUserGuideProject. This is a team project I created earlier, that currently has a single PowerShell file in it and a README.md. The README.md has been pulled down locally before, but the PowerShell file is only in the online repo.

I select the VSTSUserGuideProject team project and click Connect. It tells me I have to clone the repository before I can open solutions for this project. I’ve previously cloned this repo using the CLI tools. I wonder what will happen if I try and clone to where I had already cloned it.

So I changed the local repo location to where it was cloned earlier onto my local hard drive.

And I click the Clone button.

BAM! I get an error message. Hmmmmmmm.

Attempt #2 – Connecting To Local Repo/Team Project

Ok, so maybe I am overthinking things. Maybe I don’t have to re-clone the online repo. Maybe I can just go start using files in the local repo and things will automagically work.

In Visual Studio I select File | Open | Folder and select the local rep where I had cloned things earlier. The folder opens and I see the README.MD file.

And when I switch to Team Explorer, it now realizes I’m in a local repo for this team project.

About The Author

mickeygousset

Mickey Gousset is a DevOps Architect on the Microsoft DevOps Customer Advisory Team. He is a former Microsoft Visual Studio and Development Technologies MVP (with a focus on ALM) and author of several books related to Visual Studio, TFS, and ALM. Mickey speaks on VSTS, DevOps, and Azure at conferences around the world.