Working with Azure Repos

Working with Azure Repos

Working with Azure Repos

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In today’s blog post, we will learn how to create a new branch, then merge branches with pull request and create a new tag in Azure repos.

Prerequisites:

Create a new Azure DevOps project

Step 1: Login to your Azure DevOps portal using below link.

https://dev.azure.com/your_organization_name

Step 2: Click “New Project” and provide a name, description and visibility level for your Azure DevOps project and click ‘Create’.

Working with Azure Repos

Working with Azure Repos

Click on the Repos

Working with Azure Repos

Click on the “initialize” to initialize your Azure Repo with a README.md file. You can also import an external git-based repository by clicking on the “Import”.

Working with Azure Repos

Our Azure Repo has been initialized with a first commit.

Working with Azure Repos

How to create a new branch in Azure Repo?

Step 1: Click on “Branches” and then “New branch” to create a new branch.

Working with Azure Repos

Note: Currently you have a branch named “main” which is the default branch for your Azure repo. You can change the default branch name for a new repository using project setting page.

Working with Azure Repos

Step 2: Provide a name to your branch and a branch that the new branch is based on. Since we have only one branch “main”, our new branch will be created form this branch. Click “Create” to create the new branch.

Working with Azure Repos

A new branch named “feature” is created in your Azure repo.

Working with Azure Repos

Next, we will add some files and directory to our Azure repository, click on the branch name to get inside your branch.

How to create files and directory in Azure repo?

Step 1: Click on the options => New => Folder.

Working with Azure Repos

Note: You can also upload files from your local system to Azure repo by clicking on the “Upload file(s)”.

Working with Azure Repos

Note: You can download the content of Azure Repo by clicking on the “Download as Zip”

Working with Azure Repos

Note: You can also fork (create a new repo using content of existing repo) by clicking on “Fork”.

Working with Azure Repos

Working with Azure Repos

Step 2: Provide a folder name and file name and click “Create”.

Working with Azure Repos

Step 3: Add the content for the new file and click “Commit”.

Working with Azure Repos

Step 4: Provide a commit message and click “Commit”.

Working with Azure Repos

How to view commit messages in Azure repo?

You can view all the commit messages in your Azure Repo under commits section.

Working with Azure Repos

Next, we are going to raise a pull request to merge our feature branch with main branch.

How to raise a pull request in Azure Repo?

Step 1: Navigate to “Pull requests” section and click “New pull request”.

Working with Azure Repos

Step 2: Provide the required details like “Title”, “Description” and optionally add “Reviewer” to review and approve the changes and click “Create”.

Working with Azure Repos

If you have added approver, the approver needs to approve the changes before you can merge your branch with the main branch. Finally click “Complete” to merge the feature branch with main branch.

Working with Azure Repos

Click on “Complete merge” to merge your feature branch with the main branch.

Working with Azure Repos

Now if you look into your main branch, you will be able to see the changes that you have added in the feature branch in your main branch.

Working with Azure Repos

Next, we will create a new tag out of our merge commit.

How to create a tag in Azure repo?

Step 1: Navigate to the “Commits” section, select the commit option and click “Create tag”.

Working with Azure Repos

Step 2: Provide a tag name and description and click “Create”.

Working with Azure Repos

A new tag has been added to your Azure Repo.

Working with Azure Repos

You can also view the tags under “Tags” section.

Working with Azure Repos

Hope you have enjoyed this article. To know more about Azure DevOps, please refer below official documentation

https://docs.microsoft.com/en-us/azure/devops/?view=azure-devops

Leave a Reply

Close Menu