Azure DevOps Repos simplified

Piyush Sachdeva
4 min readApr 15, 2024

--

Introduction

Azure Repos is a version control tool suite like GitHub that allows you to manage your code efficiently. Whether you are working as a part of a team or independently, Azure Repos provides Git repositories or Team Foundation Version Control (TFVC) for source control of your code. Whether your software project is large or small, using version control as soon as possible is a good idea.

If you prefer watching a video tutorial for an end-to-end demonstration of Azure Repos, feel free to check out the video below. Otherwise, continue with the blog for the conceptual explanation.

Version Control System

Version control systems are software that helps you track changes you make in your code over time. As you edit your code, you tell the version control system to take a snapshot of your files. The system saves that snapshot permanently so you can recall it later if you need it. Use version control to save your work and coordinate code changes across your team.

Even if you are working on a personal project, version control helps you stay organized as you fix bugs and develop new features. Version control keeps your development history so you can quickly review and even roll back to any code version.

  • It helps you track changes in the codebase.
  • It maintains the history of your codebase, including who made the changes, what changes were made, why the changes were made, etc.
  • It helps you stay organized.
  • It gives you the ability to rollback the changes as needed.

Git vs. TFVC

Azure Repos supports two types of Version Control:

  • Git
  • TFVC ( Team Foundation Version Control)
Image showing the difference between Git and TFVC

Git is the most popular distributed version control system. It allows developers to download the entire code repository locally with all the versions and make the changes remotely/offline. Afterward, changes can be synced to the remote server.

To interact with Git, you can use Git clients such as Git for Windows, VSCode, etc. Git provides a version control system, but you need a hosting service to host your codebase(repositories). You can use Git hosting services such as GitHub, Azure Repos, Bitbucket, Gitlab, etc.

Team Foundation Version Control (TFVC) is a version control system that is centralized, meaning that all files are stored in a central location. Each team member typically has only one version of each file on their development machine. Historical data is maintained only on the server, where all changes and updates are recorded. Branches are created on the server and are path-based, meaning different branches of the same file can be created and managed separately.

You can host TFVC using hosting services such as Perforce, SVC, Azure Repos, etc.

Working with Branches in Azure Repos:

A local branch exists solely on your local machine. All the changes you make and commit to your local repository are stored only on your local system. To create a branch, use the command below.

git branch <branchname>
git checkout -b <branchname>
git branch <branchname> <tag>
git branch <branchname> <commit id>

Remote branches are how developers collaborate on the same project simultaneously. A remote branch exists in a remote repository (most commonly called origin by convention) and is hosted on a platform such as GitHub and Azure Repos.

git remote -v
git remote add origin git@github.com:github URL
git push origin master

When a Git repository is cloned, the default remote repository created is called the "origin" remote. It's typically the central repository for sharing changes and collaboration with other developers.

Conclusion:

In this guide for beginners, we have simplified version control concepts using Azure Repos. Understanding these concepts can enhance scalability, efficiency, and collaboration in software development. This blog post is part of the Azure DevOps Zero to Hero series, featuring full-length YouTube videos with graphics, animations, concepts, and hands-on demos of real-time projects. If you have gone through the blog, I recommend watching the entire video and doing the hands-on by following along.

References:

--

--