How to configure SECOND Source Control Repo in Visual Studio?

Viewed 341

I am using my company's laptop which is configured for TFS Source Control in Visual Studio. When I make changes to the company related project files, I can submit my changes to this Company's version control.

PROBLEM: I want to create some of my own test/personal projects and want to put them under my PERSONAL Git Repo for version control. But I am not able to do that. When I right-click on the project solution in Visual Studio and try to add source control (as shown in the screenshot below), I only see the company's TFS repo.

enter image description here

Question: How can I maintain my personal Git Repo and commit my changes on "personal" projects directly from Visual Studio?

UPDATE:

I want the test code (or personal projects) to put in my personal Git repo account, which can be accessed from anywhere by ANYONE.

1 Answers

Update:

If you want your repo be accessed from anywhere by anyone. You could choose to use Public Project in Azure DevOps Service.

An Azure DevOps Services public project provides support to share code with others and to support continuous integration/continuous deployment (CI/CD) of open source software. Users aren't required to sign in to gain read-only access to many of the services.

More details about public project you could refer official doc here: What is a public project?


According to your description. Seems you do not want to store your "private" code files on your company's TFS server but rather on your local hard drive.

Then you should not use "Add solution to Source Control" button, this is used to connect your local solution to a server side source control.

Since you just want to maintain your local codes in git repo. You could open a project that’s controlled by Git (or just git init an existing project), and select View > Team Explorer from the menu. You’ll see the "Connect" view, which looks a bit like this:

enter image description here

Visual Studio remembers all of the projects you’ve opened that are Git-controlled, and they’re available in the list at the bottom. If you don’t see the one you want there, click the "Add" link and type in the path to the working directory. Double clicking on one of the local Git repositories leads you to the Home view, which looks like The "Home" view for a Git repository in Visual Studio.. This is a hub for performing Git actions; when you’re writing code, you’ll probably spend most of your time in the "Changes" view, but when it comes time to pull down changes made by your teammates, you’ll use the "Unsynced Commits" and "Branches" views.

enter image description here

More details please refer Git in Visual Studio.


Another choice is hosting your local code on a private hosted Git provider. This make things more flexible. For example, it's easily to let you continue work on your private test projects, if you want to use your personal computer.

If you don't already have a private hosted Git provider, Azure DevOps Services is a great free option. It's the cloud version of your company's on-premise TFS server.

In addition to free GIT repos, it also provide high performance build/release pipeline, configure Kanban boards, automated and could based testing.

This will be a better option if you already familiar with workflow in your company's on-premise TFS server.

Related