How to Install and Configure Git and GitHub on Ubuntu 18.04/ Ubuntu 20.04(Linux)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys in this video I'm going to show you how you can install and configure git and github on your urban to operating system so I'm going to show you how to install gate how to configure it with github how to clone repositories how to commit your changes to get and then upload it to github so let's get started so first of all open your favorite browser we are just going to see in the official website how we can install get on Ubuntu so just search for gate and the first link which will appear here will be from gate - SCM comm this is the official web site so we are going to click on that and once this website is open you will directly see the Downloads button here which says downloads for Linux so I'm going to click on that and you will see this is this very simple command which we can use to install git so we are going to just use this apt-get install git command in order to install git so I'm going to just minimize my browser and open the terminal and once the terminal is open first of all just provide sudo command and then just paste this command which says apt - get install gate and you can also give this flag - Y which will surpass all the questions which will be asked by this command line so I'm going to press ENTER and then I'm going to give my open to pass word and then press Enter and then the installation will start so now the installation for gate is finished so we can check the gate version so I'm going to clear the terminal first of all and let's check the gate version gate - - version just give this command to know the version which you have installed for gate and this is the latest version which I have installed on my Ubuntu operating system now before we start using the gate commands let's just set up the github account and let's see how we can create a repository in github and then we are going to commit some changes to the github so once again open your favorite browser and search for github and then the first link which will appear here will be from github com so I'm going to click on this and if you are new to github you can sign up into github by giving the username your email address and your password so these are the three things you require in order to create and sign up into github I have already signed up into github and you just need to verify your email address just a normal stuff which you need to do with any other website and once you do this and you have verified your email address you can sign in to the github so I'm going to click on this button which says sign in and here you can either provide your email address or username so I'm going to provide my username and I'm going to provide my password and I'm going to just click sign in which is going to log me into my github account now here you will see this kind of interface I have already created some repositories on the github that's why you see some repositories but if you have just signed in you will not see anything here and what you need to do first of all is you need to start a new project so you can just click on this button which say start a new project or you can click on this button which says new repository so let's click on the new repository button and once you click on the new repository you will be asked to give the name of your new repository so let's say I want to create a repository for my Java program so I'm going to just say Java program which will be the name of my repository and then you can give the small description about your repository it's optional so I'm going to just say Java programs to learn and then you will see these two options one is public and another is private public repository is the one which is free so you can see anyone can see this repository you choose who can commit and the other one is private and in this repository you choose who can see and made to this repository so we are going to choose the public repository because private repository we need to you know pay something for that so I'm going to choose the public one for now and then you can also choose if you want to have readme file into your repository so I'm going to just check this checkbox and here you will be able to see two options one is the license so there are plenty of license given here you can choose whatever license you want to have for your repository let's say I want to have MIT license for this repository and also you can see this section which says add dot get ignore right now it's none and I'm going to leave it as none but let's see what are the options here for us so you can see you have all these options for your key to ignore so for now I'm going to just say none here and I'm going to just press on the create repository button which is going to create my repository and you can see now my repository is created and this is the small description I have given for my repository and this will be the readme file and the license we have chosen is the MIT license so you can see this here shows MIT license so our repository is created so we can start using the kit for github so I'm going to minimize this browser and the first thing we will do here is to configure our gate to work with github so first of all I'm going to give this command which is going to configure my username I'm also going to copy all the command which I'm writing here in the description of this video so you can always copy them and paste it into your terminal and use them so get config - - global and then space user dot name and in the double quotes you just need to provide your username so on the github my username is P knowledge you can see here you will be able to see your username just after github.com forward slash is your username you will be able to see it here or you can see your username here also so this is your username so I'm going to just provide the same username which I have on github on to the terminal inside these double quotes which is P knowledge and then press Enter so this is going to register my github username on to the gate same way we are going to configure the email address so just write get config - - global user dot email and then just provide whatever email you have used for your github account so I'm going to give my email address and then press Enter now in order to list whatever configuration you have for your agate you can give this command git config and - - list and then press enter and you can see I have given to configuration till now and both are listed here if you want to see where this file is located on your open to operating system where these informations are saved then you need to go to your home directory right now I'm in my home directory you can see this is my home directory and in your home directory there will be a file called git config so I'm going to do LS - al here to list all the files and the file we are searching for is this one which is gate config so we need to open this file I'm going to use G add it to open this file you can open this file with any other editor and then I'm going to just say dot gate config and then press Enter which is going to open this file in my editor and you will be able to see all the configurations you have done for your gate account and now we are ready to use gate with github so I'm going to clear the terminal and let's say I want to clone the repository which I have created which is Java program on my Obon to operating system so just go to the directory wherever you want to clone your repository so I'm going to create one directory with this command mkdir and let's say I'm going to just say get workspace here and I'm going to just click enter is going to create this repository so I'm going to just CD to get workspace and let's say here I want to clone my repository so to clone the repository you just need to go to your github account and just go to the repository which you have created and here you will be able to see this green button which says clone or download so I'm going to click on this option and here you will be able to see the URL to clone your repository so you just need to copy this URL which is given into this box and then I'm going to minimize my browser and you just need to give this command here so git clone and then whatever URL you have copied for your repository which is this one and I'm going to press Enter which is going to clone this Java program repository from my github account into this directory so let's provide LS command once again and you can see this Java programs repository is cloned into my folder wherever I have cloned it so let's CD to the Java programs directory and let's do LS here and you can see both the files you have a scene in your a github repository so there will be a license file and there will be read dot MD file into this directory which we have already created so let's create a Java file in which we want to write our hello world program and we want to commit this Java file into the github so I'm going to just say touch and then I'm going to just say hello world dot java and then press enter and i'm going to do LS and you can see this HelloWorld dot Java file is created and in order to open it I'm going to just do G added command and then HelloWorld dot Java and now what I'm going to do here is I'm going to just paste a simple hello world Java program here and I'm going to save this file and I'm going to close this so now this hello world Java program is there into my HelloWorld dot Java file now let's say I want to just commit this Java file into my gate and then I want to transfer this file to my github account so first of all we will see what is the status of our repository by this command just give git status and this is going to show you the status of your repository and you can see this option which says hello world in red and it will give you some useful information and this says use git add filename to include it into your commit so I'm going to just write this command get add and then the file name so I want to add this file to my gate so just write get add and then your a file name which is going to add this file to the git and once again provide the git status command and now you will see this file name which is hollow world or Java in green this means now this is the part of gate so we just need to commit this file into our gate so to commit this you can just write gate commit and then minus M which is the option to provide the comment so you can just write first Java program here so this is this will be the comment for your commit and then give your file name which is HelloWorld dot Java so I'm going to just give my file name which I want to commit and then press enter and you will be able to see this kind of message which means that your file is committed but committing doesn't mean that it will be available on your github account so when i refresh my github repository you will see the same two files so I want to see my third file which is helloworld.java so in order to push this file into your github account you just need to give this command gate push - u space or region master and then press Enter but first of all you just need to give your username my username is P knowledge and then I'm going to press enter and then give your github password whatever you have set for your github you need to give that password here so I'm going to give my github x' parts password here and then press enter and you will see all the files will be transferred to your github repository which is this one so now let's check on our github account and you can see for now there are two files here because I haven't refreshed this webpage and when I will refresh this webpage there will be a third file which is HelloWorld dot Java file and in this HelloWorld dot Java file or HelloWorld program is there so this is how you can commit and push your changes to your github account so this was the brief introduction about how to install and configure gate and github on your open to operating system I hope you've enjoyed this video please rate comment subscribe and bye for now
Info
Channel: ProgrammingKnowledge
Views: 191,558
Rating: 4.9042425 out of 5
Keywords: Ubuntu 18.04, Linux, GitHub Ubuntu, Ubuntu 16.04, Git (Software), GitHub (Website), Ubuntu (Operating System), Installation (Award-Winning Work), Repository, GNU/Linux (Operating System), Windows, Tutorial, Desktop, GitHub, git setup, git bash, git install, git package, setup git server, git clone
Id: ZMgLZUYd8Cw
Channel Id: undefined
Length: 14min 46sec (886 seconds)
Published: Sat May 26 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.