[00:00] chances are you're not using source control or you're not using it properly. and the various branching strategies that you need to use. So what is Git? [00:15] Gits been around since 2005 and is the predominant source control system Even if you're developing a project entirely on your own, It's also a lot easier to write code when you know [00:28] Now Git works on branches. This is where all your code is going to sit that is deployable and working. [00:40] Then you branch off copies off the master branch to allow you to make changes. of the master branch and make changes on their own machines. it's working, [00:54] And then it can get merged into the master branch. that you merge any changes before it gets merged in. [01:06] If you're going to be working with other developers, Now, the most popular cloud based service is GitHub, which I'm sure you've heard of, but there are also others such as Bitbucket and GitLab. [01:20] which means that you can install it on your own server. then let me know in the comments and I'll do a video about it. So GitHub allows you to have both public and private repositories [01:36] private projects as well as work on open source ones with the community. and if you spent any time in software development, Now if you're working on code, especially in a team then there's various [01:52] branching strategies that you can use in git the main two are Git Flow and GitHub Flow. but you don't have to be using GitHub to be able to use this strategy. [02:04] Now let's have a look at both of them. and we're going to go through a typical development lifecycle to see how each of them are used. [02:16] This is the branch that has all of your deployable code in it. It should be a working copy of your code, and it should match what's in production. Now the develop branch is a copy of what is currently in production, but [02:33] Now whenever we work on a feature, we're going to branch off the develop branch This lets you have a complete copy of what everyone is working on [02:45] Now let's say while you're working on the main branch, there's a production issue and you suddenly need to do a hotfix. Now this takes a copy of what's currently in production, allows you [02:59] Now what you have to do is merge hotfix back into the develop branch so that other developers have the fix in the code that they're working on. when you come to release your code. [03:15] So this would make up version 0.2 of your application. you then need to merge the code that's now in develop And then you can carry on working on your feature. [03:27] Once your feature is ready, you create a pull request which then gets Now when all of the developers are done with what they're working on Once the release has been created, developers can carry on working on [03:44] the develop branch by branching off and creating work for the next sprint. who is testing the release on another server? So generally you will do a fix on the release branch. [03:59] out, you'll merge that release into your main branch. This release also needs to get merged back into develop so all the developers This of course then gets merged into any features [04:15] that you're developing before your feature then gets merged back into develop. especially those working with Scrum especially good [04:27] that are going to be going out at different times and you need to carry on doing work while another release is being tested. flow named off the GitHub as it's the one they use internally. [04:41] GitHub flow doesn't have a release branch like you do with the Git flow. Now they have the main branch or master branch, which is their working deployable code, which is in production. Now, whenever they develop a feature, [04:56] they branch directly off of main into a feature branch, and each developer Now this then gets reviewed and merged back into main Once your feature is merged, back into main is going to be deployed [05:15] if you're using continuous delivery or at least as soon as possible. Now to be able to use GitHub flow, it relies heavily on automated testing so that you can be sure that whatever goes into main is ready for production. [05:28] GitHub flow is used to a lot of fast paced companies that need to release quickly. So generally with GitHub flow, because every feature goes into production, But I've not seen GitHub flow be used for things [05:41] and need to make sure there's no bugs in that code before they go to production. These are two main Git strategies that you'll see at companies, If you use any of these Git [05:56] If there's any others that you think I should just cover, let me know. Git flows. You use, you can pitch, which you'll pick which everyone suits you best. git flow. [06:12] Uh la la la, bugs in my code.