Getting Started with Azure DevOps Repos

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we review azure devops repos [Music] hello everyone i'm travis and this is zeraldos if you're working with a team of developers or if you're a one person shop managing scripts having a reliable code repository is important for versioning and management of the code you write in this video we go over azure repositories or repos as they're often called before that please like subscribe share with a friend and let me know your thoughts in the comments below also consider becoming a member for early access to videos your support is appreciated also check out my courses on azure virtual desktop and hybrid identities with azure id the links are below back to it a repo in azure devops is a set of versioning control tools used to manage code code can be any text file application development web pages or scripts for example are all text files during development if you have a background in programming or application development you probably understand the importance of version control systems i don't have a background in development and in the past kept my scripts on a file share or usb drive i would copy and paste to make new versions this does not scale well and doesn't work well at all when we're sharing code in a group if you're like me and coming into devops without a lot of dev experience version control for scripts may seem like an overkill but trust me it's extremely valuable when writing organizing updating and sharing code take some time with it and you'll be happy you did to get started let's review the options for repos in azure devops there are two types of repos available with azure devops first is team foundation version control or tfvc this is a centralized version control system changes are tracked in a database on a central server there's only one version of each file team foundation version control has fallen out of favor for git we'll talk about that next it may still be in use in some organizations but the industry is moving away from centralized code repositories such as team foundation version control i'm not going to spend any more time on team foundation version control for this video now let's talk about git git is a free and open source code management and version control system it's decentralized meaning it does not rely on a central server like team foundation version control git uses a lightweight client to enable version controls on the file system although it's decentralized we can still store and manage versions in a central location such as devops git repos also git is not the same as github or gitlab those are code management systems that use git just like git repos and azure devops there are other commercial and open source code management systems that leverage git they all have their own benefits and value ads in addition to using git for source code management but they are not the same as get the open source code management system the examples coming up will be with get by the way if you're getting started i have a blog series intended for those new to get especially coming from the operation side of devops the series goes over setting up get on a local computer and creating a local repo and versioning then it moves on to get with vs code the link is below if you'd like to take a look one last thing before we move on to the demos microsoft purchased github a couple years ago that may give you an indication of microsoft's commitment to get that has also led some speculation on the future of azure devops microsoft has stated there's no plan to get rid of or depreciate azure devops is going to be around for a while let's move on to the demo here we are in the azure devops portal let's create a new project we have the option for a name description if it's public or private and if we go to advanced we have the option for get or teams foundation version control let's give it a name and leave it as get to create a new get project we'll call it get test it looks like i missed the t at the end of test too late to re-record this so please overlook that mistake from the new project we can go to repos that's the icon with the three dots and the lines running between them we have an empty repo we can clone this to our local computer cloning creates a local copy get is decentralized so we don't typically work from the portal or server we copy it to the local computer and work on it there however for this example we'll use the integrated editor it gives us the option for cloning by https or ssh and we can clone directly to vs code this option works very well if you have a local copy of vs code the get agent also has to be installed on the local computer take a look at my blog post on setting that up vs code doesn't work with git until the agent is installed on the local computer by the way cloning a repository is exactly what you may think it creates a local copy of the repo including all the history the commits and branches our repo is empty we don't have any files in the repo it hasn't been initialized let's add the readme file to initialize the repo we can do that at the bottom of the page we simply click initialize that brings us to the repo we're in our main branch at this point now i've put out other content on using git specifically for loan scripters or teams of one where everything is done in the main branch although fine for teams of one it's bad forms at edit in main think of main as your production branch of code we don't want to make changes directly to production instead we'll create a new branch and work on that and pull it into the main branch when it's ready go to the drop down next to main and select new branch this one will be called dev notice we also have the option to link it to work items from the board click create and now we're in the new dev branch let's add a file go to new file and create a file this example will use the name code.txt we'll click create we're just creating a simple text file for this example that works well enough to go over the basics of git repos in azure devops let's add some text remember most code is just a series of text files we're kind of replicating that with the simple text file i'll add hello world once it looks good we can commit the branch that commits the changes to the repository it asks for a comment get into the habit of using good comments this will help you or others using your code understand what changes were made and why they were made once you've added your comments click commit now let's say we need to edit this file we can go to edit and then we'll update the file and commit it again now we'll commit and once we've added our comments we'll click commit that's enough to keep us going we're not actually writing code for this example let's look at the history of the file we can see the comments with each commit as well as who made the changes let's go to compare it shows the previous version compared to the current commit we're viewing also called head let's look at blame that shows the updates made along with the author let's go back to content we modified the dev branch let's take a quick look at main we'll switch to the main branch we get a file not found error because the file is not in main we're only modifying dev let's change back to dev and go to commits here are all the commits again it starts with where we initialize the repo with the readme file and created then updatedcode.txt let's go to push the push happens when we commit because we're working on the server if we were working on a remote clone of the branch we would have to push the local changes to the server with a push command let's go to branches here we can see the main branch in the dev branch we don't have tags set up let's go to pull requests push and pull can be confusing if you're getting started with git for example if i make a local copy of a branch and make changes i can then push those changes to the same branch to update the online version keeping the local and the remote version of the branch in sync but i may want to update the parent branch main for this example with changes from the dev branch in this case i want to request a poll of the dev branch to main this process usually requires a code review and testing a poll request usually starts that process let's go to new poll request give it a title add code.txt for this example give it a description update dev with the new code file for this example we can select a reviewer i'll add myself we also have the option to link this to a work item and add tags we can create or create it as a draft let's click create let's exit and go back into pull request this just changes the view to what a reviewer would see let's open it up here we can see files can add a comment to the file if we want to point something out let's go to updates those are the changes in the commits we've made on the file and then go to commits and there are our commits let's go back to overview as an approver i've got a few options i can approve approve with a suggestion wait for the author reject let's go to approve now that it's approved we have a couple more options we can complete it we can mark it as a draft or abandon it let's complete the merge type merge will add the history of our commits to the main branch if we had associated work items the merge would complete them automatically delete dev after merging this will remove the dev branch after it's merged to main we may want to keep this one going so all of our changes are done in dev then merge back to main when we're ready let's keep the check mark cleared on that we can also customize a commit message let's click complete merge that's done let's go back to our files now we still have our dev branch with the file we created let's switch to the main branch now the main branch has the file as well if we look at history it shows all the commits including those from the dev branch so it's preserving that history we could create another branch let's call this one test it could be based on main or dev let's leave it set to main and create let's go to our branches now it shows test as well as dev and main test is an independent branch now any changes to test won't be updated in dev until we synchronize the branches with main as you can probably imagine by now branching can get complicated if we have multiple branches all updating at different times having a branching strategy in place will add some governance around what branches are created and how they're managed speaking of that let's review the repository settings go to the project settings the gear icon in the bottom left go to repositories here we can go to settings and modify if users can manage permissions for their own branches there are several settings under policies to configure for the repo we can also set permissions on the repo under security let's go back to repositories let's go into our repository and policies and select the main branch here we have several settings to safeguard the main branch for example we can require a minimum number of reviewers within repos and project settings we can add safety rails around specific branches that provide some oversight on what changes are made to the main or other branches that is an overview of repos in azure devops i hope this helps you better understand azure devops repos don't forget to like and subscribe and thanks for watching
Info
Channel: Travis Roberts
Views: 44,507
Rating: undefined out of 5
Keywords: Repos, Repositories, Azure repos, DevOps repos, DevOps, Azure DevOps, Git, GitHub, Teams Foundation Server, TFS, Server, Code, Cloud, Cloud Services, Iot, IaC, Infrastructure as Code, azure devops tutorial for beginners, Scrum, Agile, Kanban, development
Id: qLhVWJvox7g
Channel Id: undefined
Length: 14min 0sec (840 seconds)
Published: Sun Jun 26 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.