Azure DevOps Repos Simplified
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.
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)
Git:
It 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):
It 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 Git Branches in Azure Repos
Local Branch:
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:
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 github URL/AzureRepos 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 blog we have simplified version control concepts using Azure Repos. Understanding these concepts can enhance scalability, efficiency, and collaboration in software development.
Subscribe to my newsletter
Read articles from Saikiran Goud directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Saikiran Goud
Saikiran Goud
Passionate DevOps Engineer with a strong foundation in CI/CD, automation, and cloud technologies.