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 to 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 the OK button.
It will ask you to choose a Source Control for your project. You can choose TFVC or Git, for more details on version control my article here.
Let's select Git here and click on OK, your solution is ready.
Navigate to Team Explorer and you can see the master branch was created.
Let's create a new Project from Azure DevOps, go to your account and click on the Create Project button as shown below.
Enter the project name and description and select private project so that only your team can see and work around it.
Once your project has been created, it will redirect you to the Dashboard. Select Repos from the left menu.
Copy the URL form, 'Clone to your computer'
Go to your Visual Studio Team Explorer, from the Publish to Remote Repository paste the URL that you have copied and click on 'Publish'
Enter your Azure DevOps credentials for login.
By default, it will publish your code on the master branch.
Right-click on the solution explorer and do the commit to push your code in Azure DevOps Repos.
Enter some comments so that you can keep track of your changes.
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'
It will show all the changes in the Outgoing Commits section, from there you can push it to the main master branch on Azure Repos.
On successfully pushing the changes your code will be displayed in the Azure Repos file section as shown in the below screen.
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.