- An existing Visual Studio project without any source control links.
- An existing DevOps project with default Repo
Step 1 – Open up existing Visual Studio project and create a local Git Repo
- Create a new local Git repo for your Visual Studio solution, by right-clicking the solution name in Solution Explorer, and then selecting Create Git Repository.
- In the Create a Git repository window, choose Local only, verify the local path is correct, and then choose Create.
You’ve now created a local Git repo in the Visual Studio solution folder and committed your code into that repo. Your local Git repo contains both your Visual Studio solution and Git resources.
Note: The “Create a Git repository” option may be hidden if you have a current project open that is already connected to a repository. If the option is hidden, close Visual Studio, and reopen open Visual Studio without a project.
Step 2 – Push to Git Service
- Connect to an Azure DevOps repo by right-clicking the solution name in Solution Explorer, and then selecting Push to Git service to launch the Create a Git repository window.
- In the Create a Git repository dialog, select Existing Remote. Select the repo of your DevOps project. Then select Push.