SVN Basics - Tagging and Branching

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
our fifth tutorial in and we're going to look at tags and branching we've been through installing an SVN server setting up the client tortoise SVN we've got the basics of check out and commit and we've looked at resolving conflicts in module four module five tags and branching tags allow us to give a more human friendly name to specific revisions of our folders and files so instead of using revision 1034 we could use a tag instead which might be version one branching gives us the capability to create a copy of the folders and files in our repository and a different instance of those files and folders so that we can work on them without fear of corrupting our main copy that we might be releasing to our customer and our clients and our in users so what are we trying to achieve with branches and tags then well we might have our repository on our server here and that might be repo one and we start out on that repository with a set of files and SVN labels those as revision one and then over a period of time we might make some changes who might add an additional file and SVN labels that as a revision two and so on over a period of time and we end up with revision 3 and revision 4 well we're tagging comes in is that we may decide that we want to take a set of those files and rather than go with the revision numbers that SVN gives our far set of files so our three in this example here we may decide we want to give that a more user friendly identifier so in a typical scenario you might take that revision and that set of files and you might package them up you might release them as version 1 dot zero zero of your files and it would make sense if you're releasing that as a package to your customers or end-users that you then label that or tag it in SVN as version 1.0.0 and that's what we'll see in a minute is how you can instruct SVN to take that revision3 set of files and a more user-friendly tag in this example version 1.0.0 when we get to branches and we start looking at branches then what we have is that we may have this release version 1.00 and we only ever want to make small updates to that revision so maybe we have a patch and we want to release we want a package and release version 1.0.1 and that might only include just a tiny update to one file in the package now at the same time we may want to be working on a completely new feature on our product and that may include some significant changes to our set of files and what we don't want to do is to start making those changes in either this r3 or our for revision because that would then impact our ability to release those packages at a later stage so what we would do is branch our revision 3 which is 1.00 and we would create a new set of files or a new instance if you like of the same product within the same repository and we might start working on this and making significant changes so we might add lots of more files it might make significant changes to some of those files but what we wouldn't want to do is contaminate our official releases our version 1.01 and our version 1.00 with any of those significant updates we'd want to work on those separately on this branch and make changes only on that branch and when that branch is stable then we might merge that back into the trunk and no prizes for guessing that it's called the trunk because it's the main or core set of files that were working on and releasing whereas up here we have our branch and maybe even branches off branches that have new features or experimental updates to our core set of files that we want to work on separately so what we're going to look at first stain is some examples of creating some branches and then we'll look at the tags but before we do any of that we need to set up a repository that gives us that tags and branching capability so visual SVN server we can create a new repository by clicking or right-clicking on the repository node and selecting new repository the important step here is that after we've selected the repository type more select a default and giving it the new repository name we need to select a single project repository option here if we go for the empty repository we don't get the creation of the trunk branches and tags folders which is exactly what we need for creating branches and tags so continuing selecting the defaults so all users have read and write access clicking the create button and finishing the creation of that and now when we look at this repository what we'll see is is that it starts out with three new folders our trunk which is the main location for our core files talk about that in a minute a tags folder so all of our user friendly names like version 1 will be stored in here and then the branches with our separate instances of the files and folders in our repository will be created in here and this is significantly different from our other repository that we created where the files and folders were just stored at the top level in the repository and once we created the repository we want to check that out locally into a folder on our our local system first off we need to get the repository URL so we'll copy that to the clipboard and then on our local system we will create a folder where we can check this repository out so new folder and we'll just call that repo - it's our local instance of the repository and using tortoise SVN right click tortoise SVN SVN checkout and in the checkout we want to paste in our URL of our repository for repo - click on OK and once that or once the contents of that repository have been checked out and we drill into repository - we'll see that this particular checkout supports our branches tags and trunks capability so next thing we need to create some files and folders as part of the example so we'll create those in the trunk I'll just copy those and I'm going to paste those into this folder add those folders and files to our repository and commit them so we have our first so we have our initial commit of the files into the repository and this is effectively our trunk our main set of files that we'll be working on and off that trunk will create our branches so all of those files are stored in the trunk in the repository and we want to create a branch off that trunk now the way we create a branch is not unsurprisingly if we go up a level right-clicking on the top-level folder that contains the files the trunk files selecting tortoise SVN and you'll find the option to create a branch or tag the dialog box for this gives us the the option to specify where we commit or create our branch so we don't want to do that in the trunk where we want to do this when we browse the repository is in the branch and what we need to do at this stage now we've specified it be a branch is specify the name of that branch so we can create branch ABC for example give the log message and commit that change or all that creation of the branch and one important point here is to note that the message you'll notice here specifies that once we've created that branch we are still working on the main trunk we have not moved to the branch we're working with our original set of files click OK on that and what we'll see is if we look in the branch there's currently no files in there because we have actually checked out anything from the branch we've created that branch in the repository and we can see that if we refresh in visual SVN and refresh the branch you can see branch ABC there but as SVN or the tortoise SVN client warned us we're actually still working on on our trunk set of files so what we need to do is check out that branch and we can do that by right-clicking on branches yes tortoise SVN update and we can see now that our tortoise SVN client has checked out branch ABC so if we drill into the branches we'll see branch ABC and in here we can work on a completely separate instance of our files and folders maybe add some completely new features develop test and when we're ready maybe even release the branch or merge those branch changes back into the trunk so we have one repository repo to repo to checked out locally and we have two instances of the files in that repository the trunk instance and the branch instance branch ABC the trunk instance locally and we have the branch instance branch ABC locally - so that's branching and how we work with two completely separate instances of our files and folders that are from the same repository what we'll look at now is how we create tags so if we go back to our trunk and we can create tags on either the trunk or the branches but if we work on our trunk now we can see that we have a set of files and if we right-click on their tortoise SVN and we go to show log we'll see that we're currently at revision - but revision - as we check more changes in revision3 vision for and will be upper revision 1034 at some point and it becomes difficult to track what that revision is actually about what we want to do is give it a tag that gives it a user friendly name then so at this stage of us we've got revision two we could give that an initial tag and we can right-click on the trunk tortoise SVN branches and tags and it's the same dialog box as the branching same concept what we're actually doing is creating a copy but in this instance what we want to do is say that we're creating a tag so in the two paths we change this two tags and then at the end of the tags path we want to give it a tag name and we might call this version 1.0.0 but a message on here tagging first release click on ok and again SVN tells us that we're working on the trunk and not the the tag at this stage click on OK and if gain we go to the SVN repository select our tags refresh the repository view we'll see that we now have a tag for version one zero zero so if ever we want to check out or get the version 1.00 we can on our local system check out to the tags directory our set of files that we tagged with that identifier version 1.00 and whenever we go to get that tag or the set of files associated with that tag it will always be that set of files doesn't matter whether we check in changes or modifications on the trunk or any branches revision 2 now relates to version 1.00 and whenever we update or check out that tag we get that set of files that we've just identified as version 1.00 and what typically happens in a development lifecycle in is that you know it's part of changes on our repository to set of files within the trunk we may make updates so might update file - for example I might make I'll commit those changes to the repository we'll have another version or a revision in the repository and in this instance we're looking at revision 3 or revision 5 and I may want to tag revision 5 with another unique identifier that identifies this as a formal release and that might be a patch release for example where we create the tag 1.01 and again when we go to our repository and refresh the tags folder in repo - we'll see that we now have a set of files that has been tagged or labeled as version 1.01 which is the equivalent of revision 5 useful thing to help you conceptualize this is that essentially branching and tagging are the same thing in svri SVN XY's we're just creating a copy of the files at a certain point in time for a certain revision of the files and the difference between branching and tagging is only that they are completed or copied to the branches folder or the tags folder in the SVN repository on the server so this is a very quick overview of branching and tagging there's a lot more to this including merging but this will give you just the basics to get you started something to build on from here
Info
Channel: Test Management
Views: 49,985
Rating: 4.8992443 out of 5
Keywords: SVN, Subversion, SVN basics, Subversion Basics, Introduction to Subversion, Introduction to SVN, SVN tagging, svn tags, SVN Branching, svn tutorial, svn branch, tortoise svn branching, svn branching best practices, svn tagging vs branching, svn branches tags trunk, svn tagging a release, svn branch creation, svn branch merge to trunk, svn branches tutorial, svn branching and tagging, svn tagging tutorial, svn branching and merging strategy, svn branching and merging
Id: 5ul6VZ7mP10
Channel Id: undefined
Length: 18min 4sec (1084 seconds)
Published: Sun Apr 29 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.