How To Add .NET Project Into Azure DevOps Git Repo

In this article, We will learn what is Azure Repos and how to add .net Project into Azure DevOps Git Repo Recently Microsoft introduced Azure DevOps, Azure Repos (Code in VSTS) is one of the great features of it.

Recently Microsoft introduced Azure DevOps, and Azure Repos (Code in VSTS) is one of the great features of it.

Using Azure Repos we can get unlimited cloud-hosted private Git Repos for the project. You have the freedom to work with IDE, Editor or Git client hosting and support. Semantic code search is made easy as it understands classes and variables, pull requests, and more.

In this session, we will learn what Azure Repos is and how to create a .NET project and add that in Azure DevOps Git Repos so that the team can collaborate.

Step 1

Create a .NET MVC Project, give it a proper name and click on Ok Button.

Add .NET Project Into Azure DevOps Git Repo 

It will ask you to choose a Source Control for your project. Either you can choose TFVC or Git, for more details on version control read my article here.

Add .NET Project Into Azure DevOps Git Repo 

Let's select Git here and click on Ok, your solution is ready.

Add .NET Project Into Azure DevOps Git Repo 

Navigate to Team Explorer and you can see the master branch was created.

Add .NET Project Into Azure DevOps Git Repo
Add .NET Project Into Azure DevOps Git Repo 

Let's create a new Project from the Azure DevOps, go to your account and click on create project button as shown below.

Add .NET Project Into Azure DevOps Git Repo 

Enter the project name and  description and select private project so that only your team can see and work around.

Add .NET Project Into Azure DevOps Git Repo 

Once your project has been created, it will redirect you to the Dashboard. Select Repos from the left menu.

Add .NET Project Into Azure DevOps Git Repo 

Copy the URL form, 'Clone to your computer'

Add .NET Project Into Azure DevOps Git Repo 

Go to your Visual Studio Team Explorer, from the Publish to Remote Repository paste the URL that you have copied and click on 'Publish'

Add .NET Project Into Azure DevOps Git Repo 

Enter your Azure DevOps credentials for login. 

Add .NET Project Into Azure DevOps Git Repo 

By default, it will publish your code on the master branch.

 Add .NET Project Into Azure DevOps Git Repo

Right click on the solution explorer and do the commit to push your code in Azure DevOps Repos. 

Add .NET Project Into Azure DevOps Git Repo 

Enter some comment so that you can keep track of your changes.

Add .NET Project Into Azure DevOps Git Repo 

Git has Distributed Architecture so when we commit it will first create the local commit and when you want to Sync that on Azure Repos just click on 'Sync'

Add .NET Project Into Azure DevOps Git Repo 

It will show all the changes in Outgoing Commits section, from there you can push it to the main master branch on Azure Repos.

Add .NET Project Into Azure DevOps Git Repo

Add .NET Project Into Azure DevOps Git Repo 

On successfully pushing the changes your code will be displayed in the Azure Repos file section as shown in the below screen.

Add .NET Project Into Azure DevOps Git Repo 

Thank you for reading this, in my next article we will see how to import a Git repo in Azure DevOps and how to clone the Azure Repos with the team.