Maintaining GIT projects using Azure Repos
TABLE OF CONTENTS
1. Introduction to Git2. Steps to Maintain Git3. Summary4. CloudThat 5. FAQs1. Introduction to Git
Git is a widely-used version control system that is distributed and not centralized. It is also available locally. Git is widely used to track, merge and commit files for code deployments of small-scale to large-scale projects. GIT is an essential part of a DevOps Lifecycle. It allows developers to stay updated while working on any project.
Azure Repos allows you to manage your code commits and pushes. It also visually analyzes your pull requests via an interactive interface.
You can view graphs and analytics regarding your code that has been pushed to the Azure Repos. It allows you to create new features, fix bugs, and add tags according to your requirements for point-in time versioning.
2. Steps to Maintain Git
Connect your local repository with Azure Repos
Download the GIT bash from their website to get started with GIT in your system.
When installing, make sure you check the GIT–BASH installation option.
b. Start with Azure DevOps Sign Up
Visit dev.azure.com for a free account that will allow you to use Azure Repos
Sign in using an email account, or any other option
c. Create a brand new project
Select Repos from the left blade to copy the git repository created for you by Azure DevOps
Now, open GIT BASH in Start and GIT Clone the repo at the location of your choosing
Locate the repo locally and add a file the Azure Repos
Cd demo-projectecho “hello code” > hello.txtgit addgit commit -m “az-repo first commit”1234Cd demo-projectecho “hello code” > hello.txtgit addgit commit -m “az-repo first commit”
You can now push into the Repos and see the changes reflect.
Find the committed changes in Azure Repos in Azure DevOps.
d. Explore other options to maintain commits
Only update hello.txt in the Azure DevOps portal
Locate Commits in the left Blade
Here you can now see the details of commits made by a specific branch
To show the push to git repository, click the PUSHES tab.
You can also push some code using a branch called dev. To view the commits and pushes, you can change the name of the branch from the top.
You can create new branches by clicking on the branch tab at the left blade
Select a name for your branch and choose the branch that will serve as the base for the new branch. This will allow you to pull all information from the old branch to the new one.
This tab will show you all the branches, the default and branch compared to other branches. It is used to calculate the task behind and ahead status. The behind status for non-compare branches will reset every time you submit a pull request or merge request to the compare tree.
e. Creating tags
You can create and assign tags that mark the commit for point in time versioning. This helps you search for a specific version of your code such as V1 (version 1)
f. Pull Request/ Merging
By creating a pull request on the portal, you can quickly merge code from sub-branches into main branches.
Make sure you choose the correct sub-branch to merge or any other sub-branches. You can also add reviewers to approve and assign work items. You can also choose to merge the pull request.
Go to your master branch files and you will see the dev files being pushed to the master branch.
Azure Repos allows you to view and merge files and code visually. This allows you to add other team members to view and merge their local repository. You can also continue working on your local repository and merge with other branches depending on the use case. Azure DevOps provides Boards that allow you to manage work items like Epics, user stories and tasks and analyze them. You can also create pipelines using your GIT by using the CI/CD functionality in the sections