 Welcome back to the channel. In this video, my goal number one is to make sure that git is really really simple for someone who is non-technical. But at the end of the day, someone who is doing coding or writing articles should be able to use git and platforms like github or gitlab to be able to use what we call version control systems. We have used version control before in our lives For example, when you use things like Dropbox, Google Drive and Google Sheets, we have been using version control embedded in a graphical system. Now, businesses like github and githlab have sprung up to help software developers and people who also write articles, write books to be able to reference earlier versions of their story. Have you written a story in your book before and then you end up crossing a couple of things because the grammar is wrong or because you want to reword your sentences and then five chapters into the book you think you got it wrong. So you need to reverse to what you had initially. Git allows you to do that because it keeps a version of your files. Now, for example, I am writing a very simple glossary that will allow me to explain what git is and you can see right in my github account. I'm going to show you how to open up your github account. You are able to see something that says that we have two commits here. So if I click on these two commits, you're going to see that I have this version of my repository, which is basically this project. It's a repository. We have one and two. Now, if I want, I can go to this particular version of my project and you will see it only had two lines here. Now, if I go back and go to this second version, you will see that on top of what I had before, I added a number of lines here. I can be able to see what I changed and can also revert to what I previously had. Now we're going to be able to do that practically when we start seeing what git is all about. So let's start by installing github desktop. This is a graphical user interface or GUI in short that will allow you to use git without having to go to the command line. If you want to see how to use git in the command line, I have a whole tutorial on my channel where you learn what git is about, how to open up a github account and do all these other things just using the command line. Well, simply because the command line gives you a lot more power compared to what the desktop does but the desktop version of git allows you to do all the basics and it allows you to grow into using the command line. So don't worry thinking that you're going to learn less. This is going to help you to level up and then you can move on from there to something much more. So let's download it. For us to be able to use git we need to install it on our computers. Now for people who use maccomputers that is macOS and you're in the latest version it usually comes with git and you can be able to just go to your terminal and once you reach your terminal if you type git git dash dash version you'll be able to see what version of git is installed on your computer and if you don't have that installed there is a simple guide in here and this link will be in the description you can be able to install it on your windows because windows doesn't come with git automatically so you need to be able to go to this link which is a git dash cim and that will give you a windows downloadable version of git so you will be able to download a computer that has 32 bit or 64 bit and then you would install that normally as you would any other windows program now if you are on a mac you can be able to install it using something like homebrew where you install with just one line that says brew install git or you can also go to this same link which is the download version of git the mac version download it and install it for your computer so you would be able to just click the download button here and then you would be able to install it if you are on a system like linux you can also do that you can just click on this linux version and then you would be able to use something like this command that you have here so you would copy this come to your command line and do something like this so you type sudo dash get space install space git of course that would ask you for your password because when you use the keyword of sudo you are trying to install as an administrator so you would put in your password and press enter and that would install you git on your computer once you put in your password and hit enter that will allow you to install git on your computer and you would be able to use it anywhere so that's the part about installing git if you want to see more of that you can come to this tutorial and you'll be able to see how to install git on your computer now once we've installed git on our computers the next thing we need to do is actually go to desktop.github.com and then of course this will detect what kind of operating system you're using and it will give you the big purple button for you to download for example I'm using macOS so all I would need to do is click this button but if you want the windows version you can also download it by clicking this little link down here now I'll click download for macOS I'll save this file so that I can always use it now once this download is actually done I can click open here it will allow me to extract the files that are in there and then all I need to do is just double click on this icon or this little ball that we have here and I'll click open to grant permissions for github desktop to be installed on my computer please note if we want to use the github desktop application time and again we need to add it to our applications inside the applications folder now of course this will come up on our screen and we need to either have an account already opened up for us or we need to just sign in if we already have an account that's already open so let's go ahead and create a free account on github let's go ahead and click this when we click that link it will bring us to github.com right here and that this place is where we can sign up so I'll sign up for a free account I'll choose a username my email and then I'll choose to have a password so I'll allow my computer to choose a password for me and then I'll choose where I want to get all of these and then of course there's some security questions that I need to add here and then I'll be able to create an account the next step for me is I'm going to choose what kind of work I'm doing and this is basically to help github make things better and for now all I'm going to say and I have no programming experience whatsoever and all I'm doing is I want to learn github and once I hit this button I'll be ready to start so all I need to do is go and verify my email and then I'll be able to start using github now once I'm in my email box I'll just click verify to verify my email and my account is created to actually start using github so the one thing that I can do is I can either choose to have a number of organizations within my account so that I can manage different projects in those organizations or I can run everything inside one account so what I'm going to do is just create a repository when we use the word repository we're just talking about a project and the projects that I'm going to talk about is writing about ants so let's assume this is going to be where I'm going to write about ants and everything about them I can give these descriptions and say ants are really cool insects read about them so I can choose to have this project or this repository as public or private now the difference is with a private nobody will be able to access this project or see that it exists unless you have specifically invited them to see the project only you who is logged into this account will be able to see it whereas if it's public it's actually searchable and people can find it as long as they know your github name or if they find it in the results on github so we are going to create one that's public and find about our really cool ants the next thing that we need to do is we can add a readme file that basically has simple things about your project explaining what it's about telling people how they can contribute and so on now you can choose to add what we call a gitignore file and those are files that should be ignored whenever you are going to publish files from your computer to your online platform and you can also choose a license that helps you deal with your work in the best way to avoid having copyright infringements by other people who might want to use your work so let's create this repository and of course you have your project writing about ants here this is the readme file you can always come and use the online platform maybe take this out and then you go and add what we call as a commit message so here you'll be able to say remove remove words you need to use something that's descriptive for people to be able to understand what your commit is all about so I do not need these words they are superfluous so I'm going to commit this directly into my branch and now you see we don't have that word we have what is new but we can be able to go into our history and we'll be able to see what happened the first time what did we have we had this and then the next time in our history we were able to we'll be able to see what you changed about your particular project maybe we'll remove these words whatever is in green is what's current whatever is in red is what has been removed so you can be able to make comments about this and you can make so many commits right in the github platform right here so you don't need to download anything or use it but what happens when you want to do your work offline maybe you're working in a remote area and you still want to have inside your project but you do not have internet that's where github desktop comes in you'll be able to make the different commits and have a history that's being tracked yet you're waiting to have the internet connection come up and then you'll send all your details online so let's see how to do that so we are going to come back here and we'll click sign in which will open up this link for us we'll say authorize desktop and that is going to allow us to open the link that has come up and I'm going to click continue to configure or uncheck this depending on my preference so for now I'll uncheck it I'll click finish now this is going to show me all the repositories that I have available inside my account so I can either create a new repository from local or I can clone which is basically get another repository from someone else who is also on the github platform maybe you like what they are doing so you can copy from them and make something your own or you can create your own repository on your hard drive and then later push it up into the cloud or you can actually choose to copy an existing repository from the cloud and then drive it to your computer so what I'm going to do is just click what we have here and I'm going to copy this and all I'm going to do is allow this to come onto my computer and it's going to go inside my documents inside github and create a folder there so I'll click clone and you're going to see that we have our local folder with all this information you can click showing finder and you'll see that we have this little readme file I can open up this file by right clicking it and opening it with an editor of my choice so for example I'm going to choose to open it up with visual studio code because I already have this open on my computer but you can open it with not bad or any other program that finds this file extension readable so I'm going to open this up in visual studio code and then we'll be good to go so visual studio code has opened this up and you'll see that we have our title here and we have our description so what I'm going to do is actually change this and make this uppercase and remove everything else that was in dashes I'll save this and then let's go back if you look at my visual studio code it's telling me that there's something that has changed inside my project so I'm going to go and look inside my github desktop and you'll see that this line was changed and these are the changes that were made so what I can do at this point is I can just go and make what we call a commit message so I can say remove dashes from title the title does not need dashes so once I'm done with that I'm going to click commit to main and that has already gone inside my history now github desktop is so smart that it gives you this option it says please push this to the origin so it's basically telling you push this in the cloud so that if in case your computer crashed you will be able to pick that up from wherever so all I'm going to do is click push and once I push this it's going to get the copy from my local computer with all the history and it's going to send it to the cloud version so I'm going to just look here at history and you're going to see that when we first made this repository we had this we now have this version that was later changed and now we have removed the dashes so we are able to go within the history and find out what changes have been made what new files have been included what did we mess up and how can we bring it back so let me go onto the online version and I'm going to go back inside this part that says code and you're going to see that our titan no longer has those dashes and we have this message from our local computer that says remove dashes from title and if we want we can still browse the history and we can be able to follow up on what changes were made in our files so you can see from this that the big win for us is just being able to see the history and be able to make changes so what happens if I decide to make some changes online and I move to a faraway country and I need to access the new version of my code so let's make some changes here and say this is a port that was done by John Doe in 1956 so what we're going to do is we're going to cite author and we'll say add the citation so the next thing we're going to do is we're going to commit those changes which is basically say let's record the changes and this is what it looks like when I come back to my github desktop here I have this button here that says search origin and when I click it it is going to go and look in the online version and then it's going to tell me there are some changes that we do have inside our project so what I can do is I can click pull origin and I'm going to pull everything that has changed and I'm going to put it in my local version of the file and you can see right now we have cite and we have the message that tells us add the citation and you can see the changes that were made is we added someone inside our project so if I go back to my editor you see I didn't have to refresh anything it automatically had this refreshed and I can make more and more changes now this is really good making changes and having the history is good but what happens when we want to go off this train truck and make a couple of changes on the side then bring them back this usually happens when we have a number of people working on the project so let's imagine this is the story we were writing we gave it to our editor to look at so we have an editor that's one party we have neither author would probably like to make some changes but I would like the editor maybe to see them a little later and maybe we have someone who is reading the book let's say who is a publisher and they want to make some changes and so on so they can be able to also have their own version of this book so that's where we come in with the word that is branches we are branching away from the main project but later we are going to bring back every change and add it in so how do we make branches let me go back to my github desktop the way we make branches is we can come to any project that we have here click this icon and say new branch now in the new branch we are going to have the editor version so we create this branch here and inside the editor version if I come back to my story here and I'll say the editor made changes and save this and the next thing that we are going to come back to our github desktop and we are going to go and see here the changes and you say editor changes say the editor likes our work and then I am going to commit this to the editor branch now what happens we have this new button here we also have it here which says publish the branch remember when we publish or when we push we are sending information to the online version so I'll click publish branch and it's going to push it to the origin basically the online version so this has been pushed to the origin let's go back to our browser version I'm going to reload this and you're now going to see that we have this little drop down and we have what we call the branches so we have the main branch still has the original work it hasn't changed but if I go to the editor branch you're going to see that it has the editor's changes and in the history you can be able to see editor's changes but if we go to the main branch and click on the history you're going to see we don't have that part of the editor making changes so we can make a number of branches depending on what features we want to add to our project or when we want to do something different and later merge it now I brought in a new word which is merging it's basically the English form of just getting something and putting it inside your sham project so we can actually merge different things together so right here I'm going to go to my main branch so if we want to get our branch which is editor and then push it inside our main branch we make something called a pool request and in short that is PR so we can always go to the branch that we have here and we can say compare branches or we can say create pool request this will open up in the online version and it will give us this new dialogue box that shows us what changes were made down here what files did we change and then we can write a message here with the proper title and we can write a message here showing why we made various changes and you can see that we are comparing two branches we are comparing the main and we are comparing it with the editor so I can click create pool request here and this is going to trigger a message to the owner of that project that there is a new pool request someone wants to make some changes from their particular branch now I can merge this pool request after viewing the changes that have been made and I think I appreciate them I can either make some comments here or I can decide to merge this pool request so I will click merge pool request then I will confirm the pool request and now when we go back to our code and we look in the main branch you are going to see that we have the editor made changes which was not the case before so if I go back to my local file and then go to the main branch you will see it is telling me fetch from origin fetching does not change what you have locally it just basically goes to check if there are any new changes and then it will give you the option of actually pooling the origin down local now depending on the branches that you have or the active branch it is going to pool branch to branch so it is going to pool the main to the main so I will click pool origin and when I go back inside my editor you will see that the changes of the editor have actually been pooled inside my main branch so far we have learnt about merging we have learnt about pool requests we have learnt about branching out and making changes and we have seen the essence of having a history inside our different projects we have been able to work with our own projects for now but let's imagine somebody else give us a link to their own project and say please go ahead look at the project find out what you like then make some changes and then make a peer back pool request to the project so we come to the concept that is known as forking so let me just go and try out one of those projects so let's say this is the link to the project that was given to us it does not belong to us but we can make a copy of it thereby forking it make changes and then make some pool requests back so the first thing that we are going to do to this project is we cannot directly edit it so we need to first and foremost fork it so I am going to fork this project basically I am just copying the project and making my own copy now I am able to make changes to this particular copy so what I am going to do is go back to my github desktop I am going to go to file and then I am going to say clone repository so what I am going to do is just copy this link of our new project I will paste the link there and I am going to say clone now you will see we have this question here that says are you planning to use this fork you have changes on this branch what would you like to do with them do you want to contribute to the parent project which is this and I will say yes if I don't intend on making any contribution to that project I will say for my own purposes so I intend to work with the parent project so I will click continue and that of course is going to allow me to have this showing that is good so the next thing that we need to do is go back to our desktop we are going to go and you will see that we have this github desktop already here so I am going to open this up inside my editor so I will click this open it up in visual studio editor and you will see that we have all these different things so I am going to make some changes here and you can see that if I preview this we have made some changes to our titles we have given this a second hierarchy we have made this bald so I can do the same thing for all the others like clone if I make these changes here you will be able to see that this is bald and it is looking a little bit better so those are good changes to have on a project what I am going to do is save this and then when I come back to my github desktop here you will be able to see the changes that I have made and I can be able to say making better titles and that is my title of my commit and I will say add headings to and bald titles what I am going to do is just commit this to my main it is usually not a good practice to commit to the main you would rather make a branch and then push those changes and then merge them later because you do not know what someone is doing at the other end you would like to have the main always be a place where people can get a fresh copy before any other changes have been merged in for now I will create commit to main and then you will see push commit to the origin remote this basically means I am going to push to my own fork of the project so I will click push origin and you will see let's go and check online if we come back to our fork we are on our fork right now and I reload this you are going to see that the changes we have made are actually visible right here you can see from this title and this one now you will also see it says this branch is one commit ahead of this other project where we forked from now if we want to make a pull request we can just click this little pull request button and that will make a request to the original fork however we can also come to the repository and we are going to say create pull request so I will click create pull request and you will see that it is going to compare the original file which is on this account inside this and inside the main branch and we are going to compare it with my own personal branch so maybe we don't want to commit to the main branch we want to commit to another branch we can always change those and that will make it easier for us to commit to the branch that we want to so what I am going to do here is just click create pull request I will use the same things that I had here in my own version the changes are still available I can preview them then I will create pull request so once I create pull request you will see that here I don't have the match button because I am not the owner of the project so all I need to do is just wait for the owner of the project to accept my pull request and that will be merged into the project that I forked so we usually call this project which you have forked from we call it the upstream so the upstream project will have to verify and merge my pull request so luckily our pull request got merged and you will see that now this is merged and if we go to the code of this you will see that it has better making titles we are not on our project anymore we are on the upstream we are on the original forked project it has everything that has merged in you will see the message here says there was a merge pull request from this particular person and we can now look at the history and we have this merged from this person and this is the commit we can look at the changes that were made and we can see whatever is good and whatever is bad so we can make comments to that if we want to and that's how we work with forking a project making changes to it and then pushing back the changes so these are the basics of github desktop and using github and add version control to them if you enjoyed the video please give it a thumbs up and don't forget to subscribe to the channel if you like the content from here don't forget to leave a question in the comment section otherwise