{"id":3038,"date":"2022-04-21T08:38:29","date_gmt":"2022-04-21T08:38:29","guid":{"rendered":"https:\/\/exceedthecloud.com\/?p=3038"},"modified":"2022-04-21T08:38:34","modified_gmt":"2022-04-21T08:38:34","slug":"manage-branches-from-azure-devops","status":"publish","type":"post","link":"https:\/\/exceedthecloud.com\/?p=3038","title":{"rendered":"Manage branches from Azure DevOps"},"content":{"rendered":"\n<p>In this Lab, you will work with branches by using Azure DevOps. You can manage your repo branches directly from the Azure DevOps portal, in addition to the functionality available in Visual Studio Code.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Task 1: Create a new branch<\/strong><\/p>\n\n\n\n<p>In this task, you will create a branch by using the Azure DevOps portal and use fetch it by using Visual Studio Code.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\"><li>Switch to the web browser displaying your Azure DevOps organization with the\u00a0<strong>Version Controlling with Git in Azure Repos<\/strong>\u00a0project you generated in the previous Lab.<\/li><\/ul>\n\n\n\n<p><strong>Note<\/strong>: Alternatively, you can access the project page directly by navigating to the [https:\/\/dev.azure.com\/&lt;your-Azure-DevOps-account-name&gt;\/Version%20Controlling%20with%20Git%20in%20Azure%20Repos) URL, where the&nbsp;&lt;your-Azure-DevOps-account-name&gt;&nbsp;placeholder, represents your account name.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\" start=\"2\"><li>In the web browser window, navigate to the\u00a0<strong>Repos<\/strong>\u00a0pane of the project and select\u00a0<strong>Branches<\/strong>.<\/li><li>On the\u00a0<strong>Branches<\/strong>\u00a0pane, click\u00a0<strong>New branch<\/strong>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"349\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture1-3.png\" alt=\"\" class=\"wp-image-3039\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture1-3.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture1-3-300x168.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>In the\u00a0<strong>Create a branch<\/strong>\u00a0panel, in the\u00a0<strong>Name<\/strong>\u00a0textbox, type\u00a0<strong>release<\/strong>, ensure that\u00a0<strong>master<\/strong>\u00a0appears in the\u00a0<strong>Based on<\/strong>\u00a0dropdown list, in the\u00a0<strong>Work items to link<\/strong>\u00a0drop-down list, select one or more available work items, and click\u00a0<strong>Create<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"475\" height=\"412\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture2-3.png\" alt=\"\" class=\"wp-image-3040\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture2-3.png 475w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture2-3-300x260.png 300w\" sizes=\"auto, (max-width: 475px) 100vw, 475px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\"><li>Switch to the\u00a0<strong>Visual Studio Code<\/strong>\u00a0window.<\/li><li>Press\u00a0<strong>Ctrl+Shift+P<\/strong>\u00a0to open the\u00a0<strong>Command Palette<\/strong>.<\/li><li>At the\u00a0<strong>Command Palette<\/strong>\u00a0prompt, start typing\u00a0<strong>Git: Fetch<\/strong>\u00a0and select\u00a0<strong>Git: Fetch<\/strong>\u00a0when it becomes visible. This command will update the origin branches in the local snapshot.<\/li><li>In the lower left corner of the Visual Studio Code window, click the\u00a0<strong>master<\/strong>\u00a0entry again.<\/li><li>In the list of branches, select\u00a0<strong>origin\/release<\/strong>. This will create a new local branch called\u00a0<strong>release<\/strong>\u00a0and check it out.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"317\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture3-3.png\" alt=\"\" class=\"wp-image-3041\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture3-3.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture3-3-300x152.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Task 2: Delete and restore a branch<\/strong><\/p>\n\n\n\n<p>In this task, you will use the Azure DevOps portal to delete and restore the branch you created in the previous task.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\"><li>Switch to the web browser displaying the\u00a0<strong>Mine<\/strong>\u00a0tab of the\u00a0<strong>Branches<\/strong>\u00a0pane in the Azure DevOps portal.<\/li><li>On the\u00a0<strong>Mine<\/strong>\u00a0tab of the\u00a0<strong>Branches<\/strong>\u00a0pane, hover the mouse pointer over the\u00a0<strong>release<\/strong>\u00a0branch entry to reveal the ellipsis symbol on the right side.<\/li><li>Click the ellipsis, in the pop-up menu, select\u00a0<strong>Delete branch<\/strong>, and, when prompted for confirmation, click\u00a0<strong>Delete<\/strong>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"446\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture4-3.png\" alt=\"\" class=\"wp-image-3042\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture4-3.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture4-3-300x214.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\"><li>On the\u00a0<strong>Mine<\/strong>\u00a0tab of the\u00a0<strong>Branches<\/strong>\u00a0pane, select the\u00a0<strong>All<\/strong>\u00a0tab.<\/li><li>On the\u00a0<strong>All<\/strong>\u00a0tab of the\u00a0<strong>Branches<\/strong>\u00a0pane, in the\u00a0<strong>Search branch name<\/strong>\u00a0text box, type\u00a0<strong>release<\/strong>.<\/li><li>Review the\u00a0<strong>Deleted branches<\/strong>\u00a0section containing the entry representing the newly deleted branch.<\/li><li>In the\u00a0<strong>Deleted branches<\/strong>\u00a0section, hover the mouse pointer over the\u00a0<strong>release<\/strong>\u00a0branch entry to reveal the ellipsis symbol on the right side.<\/li><li>Click the ellipsis, in the pop-up menu and select\u00a0<strong>Restore branch<\/strong>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"433\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture5-3.png\" alt=\"\" class=\"wp-image-3043\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture5-3.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture5-3-300x208.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p><strong>Note<\/strong>: You can use this functionality to restore a deleted branch as long as you know its exact name.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Task 3: Lock and unlock a branch<\/strong><\/p>\n\n\n\n<p>In this task, you will use the Azure DevOps portal to lock and unlock the master branch.<\/p>\n\n\n\n<p>Locking is ideal for preventing new changes that might conflict with an important merge or to place a branch into a read-only state. Alternatively, you can use branch policies and pull requests instead of locking if you just want to ensure that changes in a branch are reviewed before they are merged.<\/p>\n\n\n\n<p>Locking does not prevent cloning of a repo or fetching updates made in the branch into your local repo. If you lock a branch, share with your team the reason for locking it and make sure they know what to do to work with the branch after it is unlocked.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\"><li>Switch to the web browser displaying the\u00a0<strong>Mine<\/strong>\u00a0tab of the\u00a0<strong>Branches<\/strong>\u00a0pane in the Azure DevOps portal.<\/li><li>On the\u00a0<strong>Mine<\/strong>\u00a0tab of the\u00a0<strong>Branches<\/strong>\u00a0pane, hover the mouse pointer over the\u00a0<strong>master<\/strong>\u00a0branch entry to reveal the ellipsis symbol on the right side.<\/li><li>Click the ellipsis and, in the pop-up menu, select\u00a0<strong>Lock<\/strong>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"472\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture6-3.png\" alt=\"\" class=\"wp-image-3044\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture6-3.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture6-3-300x227.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\"><li>On the\u00a0<strong>Mine<\/strong>\u00a0tab of the\u00a0<strong>Branches<\/strong>\u00a0pane, hover the mouse pointer over the\u00a0<strong>master<\/strong>\u00a0branch entry to reveal the ellipsis symbol on the right side.<\/li><li>Click the ellipsis and, in the pop-up menu, select\u00a0<strong>Unlock<\/strong>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"443\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture7-3.png\" alt=\"\" class=\"wp-image-3045\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture7-3.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture7-3-300x213.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Task 4: Tag a release<\/strong><\/p>\n\n\n\n<p>In this task, you will use the Azure DevOps portal to tag a release in the Azure DevOps Repos.<\/p>\n\n\n\n<p>The product team has decided that the current version of the site should be released as v1.1.0-beta.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\"><li>In the vertical navigational pane of the of the Azure DevOps portal, in the\u00a0<strong>Repos<\/strong>\u00a0section, select\u00a0<strong>Tags<\/strong>.<\/li><li>In the\u00a0<strong>Tags<\/strong>\u00a0pane, click\u00a0<strong>New tag<\/strong>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"314\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture8-3.png\" alt=\"\" class=\"wp-image-3046\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture8-3.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture8-3-300x151.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>In the\u00a0<strong>Create a tag<\/strong>\u00a0panel, in the\u00a0<strong>Name<\/strong>\u00a0text box, type\u00a0<strong>v1.1.0-beta<\/strong>, in the\u00a0<strong>Based on<\/strong>\u00a0drop-down list leave the\u00a0<strong>master<\/strong>\u00a0entry selected, in the\u00a0<strong>Description<\/strong>\u00a0text box, type\u00a0<strong>Beta release v1.1.0<\/strong>\u00a0and click\u00a0<strong>Create<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"476\" height=\"375\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture9-3.png\" alt=\"\" class=\"wp-image-3047\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture9-3.png 476w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture9-3-300x236.png 300w\" sizes=\"auto, (max-width: 476px) 100vw, 476px\" \/><\/figure>\n\n\n\n<p><strong>Note<\/strong>: You have now tagged the project at this release. You could tag commits for a variety of reasons and Azure DevOps offers the flexibility to edit and delete them, as well as manage their permissions.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Lab 3: Manage repositories<\/strong><\/p>\n\n\n\n<p>In this Lab, you will use the Azure DevOps portal to create and delete a Git repository in Azure DevOps Repos.<\/p>\n\n\n\n<p>You can create Git repos in team projects to manage your project\u2019s source code. Each Git repo has its own set of permissions and branches to isolate itself from other work in your project.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Task 1: Create a new repo from Azure DevOps<\/strong><\/p>\n\n\n\n<p>In this task, you will use the Azure DevOps portal to create a Git repository in Azure DevOps Repos.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\"><li>In the web browser displaying the Azure DevOps portal, in the vertical navigational pane, click the plus sign in the upper left corner, directly to the right of the project name and, in the cascading menu, click\u00a0<strong>New repository<\/strong>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"311\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture10-3.png\" alt=\"\" class=\"wp-image-3048\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture10-3.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture10-3-300x150.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>In the\u00a0<strong>Create a repository<\/strong>\u00a0pane, in the\u00a0<strong>Repository type<\/strong>, leave the default\u00a0<strong>Git<\/strong>\u00a0entry, in the\u00a0<strong>Repository name<\/strong>\u00a0text box, type\u00a0<strong>New Repo<\/strong>, leave other settings with their default values, and click\u00a0<strong>Create<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"843\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture11-3.png\" alt=\"\" class=\"wp-image-3049\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture11-3.png 474w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture11-3-169x300.png 169w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Note<\/strong>: You have the option to create a file named\u00a0<strong>README.md<\/strong>. This would be the default markdown file that is rendered when someone navigates to the repo root with a web browser. Additionally, you can preconfigure the repo with a\u00a0<strong>.gitignore<\/strong>\u00a0file. This file specifies which files, based on naming pattern and\/or path, to ignore from source control. There are multiple templates available that include the common patterns and paths to ignore based on the project type you are creating.<\/p>\n\n\n\n<p><strong>Note<\/strong>: At this point, your repo is available. You can now clone it with Visual Studio Code or any other git-compatible tool.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Task 2: Delete and rename Git repos<\/strong><\/p>\n\n\n\n<p>In this task, you will use the Azure DevOps portal to delete a Git repository in Azure DevOps Repos.<\/p>\n\n\n\n<p>Sometimes you\u2019ll have a need to rename or delete a repo, which is just as easy.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\"><li>In the web browser displaying the Azure DevOps portal, at the bottom of the vertical navigational pane, click\u00a0<strong>Project settings<\/strong>.<\/li><li>In the\u00a0<strong>Project Settings<\/strong>\u00a0vertical navigational pane, scroll down to the\u00a0<strong>Repos<\/strong>\u00a0section and click\u00a0<strong>Repositories<\/strong>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"417\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture12-3.png\" alt=\"\" class=\"wp-image-3050\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture12-3.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture12-3-300x200.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\"><li>On the\u00a0<strong>Repositories<\/strong>\u00a0tab of the\u00a0<strong>All Repositories<\/strong>\u00a0pane, hover the mouse pointer over the\u00a0<strong>New Repo<\/strong>\u00a0branch entry to reveal the ellipsis symbol on the right side.<\/li><li>Click the ellipsis, in the pop-up menu, select\u00a0<strong>Delete<\/strong>, in the\u00a0<strong>Delete New Repo repository<\/strong>\u00a0panel, type\u00a0<strong>New Repo<\/strong>, and click\u00a0<strong>Delete<\/strong>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"204\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture13-2.png\" alt=\"\" class=\"wp-image-3051\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture13-2.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/Picture13-2-300x98.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Review<\/strong><\/p>\n\n\n\n<p>In this lab, you used the Azure DevOps portal to manage branches and repositories.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Lab, you will work with branches by using Azure DevOps. You can manage your repo branches directly from the Azure DevOps portal, in addition to the functionality available in Visual Studio Code. Task 1: Create a new branch &hellip; <a href=\"https:\/\/exceedthecloud.com\/?p=3038\">Continued<\/a><\/p>\n","protected":false},"author":1,"featured_media":3054,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"kt_blocks_editor_width":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[16,4],"tags":[8,105,53,54],"class_list":["post-3038","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-practical-labs-series","tag-azure","tag-devops","tag-git","tag-visual-studio-code"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/04\/istockphoto-1351548453-612x612-1.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts\/3038","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3038"}],"version-history":[{"count":2,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts\/3038\/revisions"}],"predecessor-version":[{"id":3053,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts\/3038\/revisions\/3053"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/media\/3054"}],"wp:attachment":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}