How to Setup and Configure Git on Ubuntu 22.04 | Step-by-Step Tutorial #skillsharp #git #ubuntu

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone welcome back to the skill Shop Channel and today we are going to set up git in our uban 2 22.4 so for that let's go and open our terminal so I'm going to hit control alt and T so you can see here my terminal is open I will increase the font size of the terminal so that you can see whatever command I am using properly I think this is enough okay so first of all let's check git is there in our system or not g iph hyph version so here you can see command G not found okay so it means G is not installed in our system properly or not installed even it so let's first update our system for that use the command sud sudo a update it will ask for the password okay now you can see the system is updated successfully so now let's install git for that I'm using sud sudo AP install git and hit enter so you can see installation of git is started on our system okay now git is successfully installed in our system to check that we can use the command git space hyphen hyphen version and you can see the git 234. one is installed successfully in our system right so what is the uh git git is actually a version control system as you all know right so let's first of all configure some things or some parameters in our git so like username and email so for that I'm going to use the command so let's clear the screen okay let's use the command get config iph iph Global space user.name space I'm going to provide my username okay so this is my username you can see so it is updated let's update our email address as well so while updating email address instead of user.name you use user. email okay and you can provide your email here and hit enter so the global parameters are configured for git you can check the global parameter with the command git config iph iPhone list and you can see here username and email address this is shown here okay so now let's create one repository in GitHub so I'm going to my browser so you can see here this is the Mula Firefox and let's go to GitHub okay so this is the github's official site oh you can see I have logged in in my GitHub and you if you don't have GitHub account then you can uh fairly easily create your GitHub account okay so here this is my GitHub account you can see this is the profile my username is here okay let's create one new repository so here I'm going to create a new repository by clicking on this new button first of all let's you the repository name Linux G demo okay so here let's give some description here we are setting up get in open2 okay you can create either public repository or private repository so I am going to create public repository for now you can add read me file if you want so I'm going to check it right now here uh some G ignore files are there according to whatever project you are creating you can select from here this dropdown list and get license is also there so you can provide the licenses for your repository as as well and once you hit on this create repository button you can see this is your G repository created and this is the readme file and in the rme file you can see uh you can see Linux git demo and this so let's clone this repository to our local so from here I can copy the link you can see this is the link and let's go to our terminal so you can see I am right now in my users directory so let let's create one folder mkd projects okay you can see projects folder is created so let's navigate to that folder okay so now clone the repository here so I'm going to clone it get clone and I'm going to paste the link we have copied and I'm going to hit enter so you can see git repository is clone at my system okay so the git reposit is clone so let's do LS and you can see Linux git demo is here let's go into that CD okay and let's again LS you can see the readme.md file is there so let's see what is the content of readme.md file and you can see this is the content that is present in our online repository right so let's create uh one python file okay so I'm going to create I'm in this repository right so I'm going to create one python file touch sample. py okay and uh let's open this python file over this project in some code editor so right now I'm going to open vs code for that I'm going to use the command codespace Dot and hit enter so you can see vs code is open in that directory okay and this is our sample python file so let's create sample code data engineering lab demo okay so this is our sample code I'm going to save this file and I'm going to exit the vs code okay so now I can see cat you can see the code is there in my repo okay in my file okay so now let's see is the uh let's see get status for this so you can see there is one file is created and that file is untracked file so here you can see it is showing in the red color so this file is not getting tracked so for uh adding this file to staging area we need to use the command get add and sample. py now if I run the command G status you can see now the changes are you you can see the changes to be committed but right now the file is in our staging area the file is staged and you can see it is in green color so it means the file is being tracked right now okay so I need to commit this file so for that I can use the command get commit hphm and I can commit you can use commit message sample python file added too and hit enter so you can see added to the repo and uh the file is committed successfully right so now let's try to use the G status and you can see on Branch main there is nothing to uh right nothing to commit or add so what you how I can like uh like push this file to the remote repository or into our GitHub account right so let's try to do that so I'm going to use get push and hit enter so it will ask for my password okay so I'm going to use my password this is the user ID right and after that it will ask for password so I will enter the password okay so it is not committed right it is not pushed why because the support for the password authentication was removed on August 13 2021 so right now there is another method uh so that we can push it so for that let's come to our G repository and here go on your profile icon and at the bottom you can see settings is there so just hit on the settings and just scroll down the page on the this navigation bar or the Side Bar you can see developer setting is there just hit the developer settings now you can see the o o and personal access token are there so just open the drop down and here you can see two types of the personal access token so I am going to use the token classic so just hit on the token Classics you can see I have already used uh some tokens for some other uh repositories right so you can create a new token so generate a new token and from here generate a token classic right so it will ask you for the password okay so now don't save my password so you can see from here we can create a token so token for get them and uh you can from here you can select how much days or how much time this token will be there so I will select for 7 Days right now and I will add all kind of permission to this for now in our future videos we will see all this permission and what are all the things we can do by allowing disallowing this permission to our tokenization method okay uh for time being and for the just a simple demo right now I am going to select all the permissions for this specific authentication token authentication method okay so I have selected everything and you can see generate token is here so just hit on the generate token so you can see here you can see the token and this is the token by click clicking here you can copy the token one important thing is there make sure copy your personal access token now once you will uh go back on this page or this page is removed from browser you won't be able to access this token anyhow okay so just copy this token right and uh let's come again to our terminal and let's try to push our repository again so I'm going to use G push so it will ask my username again so I have provided my username so it will ask for the password so instead of password right now I'm going to paste the token and hit enter so you can see right now four objects are done and you can see the uh whatever file the python file is pushed to get sub repo successfully and here if I go and show you the first thing what I will do is I will uh save this access token for further use okay and I will save it to one text file let's go to our git repository and here you can see this is our GitHub let's go to our home home all right so this is our repo so let's find our repo so Linux project repo okay so this is our Linux git demo this is our repo so I'm going to hit and open this repo and now you can see the sample. py file is there in our main branch of the G repository I will open the sample. py and you can see the the line of code is there in this sample. py right okay so in this way you can create or you can set up your uh GitHub on your Ubuntu Server so I think this video is quite helpful for you and uh if you think this is the helpful then don't forget to like this video and share this video with the one who need how to set up G on ubu system I will see you in the next video till then Happy coding
Info
Channel: SkillSharp
Views: 84
Rating: undefined out of 5
Keywords: ubuntu, git, version control, github, repository, configuration, setup, tutorial, linux, command line, programming, development, software, coding, python, authentication, token, skillsharp, beginner, open source, Skillsharp
Id: 4yhBjQplba8
Channel Id: undefined
Length: 15min 30sec (930 seconds)
Published: Fri Feb 23 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.