Git And GitHub Tutorial For Beginners 2024 - How to learn git

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back with another video today we are going to learn about get and GitHub tutorial so this video is from scratch where we going to discuss about from the basic to the advanced topic and I know there are tons of videos are already uploaded on YouTube channel but this video will be very interesting because we will take a one project and we will deploy in the GitHub also you will able to deploy your application after watching this video so the topic that we are going to cover is understanding about git and how git is difference with the GitHub and also like developer workflow of course we're going to learn about the git and GitHub commands not only the command but also we will learn about from the scratch like what how to configure git with the GitHub and the important topics like branches and how to merge that also we're going to discuss about the merge conflict so that is very important topics all right so let's understand about the concept of git so git is very popular version controller and it is a open source utility or you can say that it is a software that basically install in your local machine the purpose of using this git is very simple and useful that uh suppose you are writing a code right you are building a website or you are a developer you are writing a code and you are doing some changes in the code and whenever you are saving your code the git will create your new version so it is like that you are saving your new code and that git is tracking down your activities and saving your code and then give you the new version of that so it will use to track down your source code easily and will will give you the basically complete information like who made the changes and what the changes has been made and when the changes has made right so these information will be stored in the get hidden folder that you can easily roll back with the previous version suppose you you develop a website and you added a new feature for your uh client now your client is saying that I don't need this feature I want the previous version of the website so that you what you can do that you can simply roll back with the previous version with just one command so git is very popular and useful and every developers is using it now then what is the difference between GitHub and git so the key difference between GitHub and git is very simple let's understand about git first because git is a main uh utility that we need to understand so G is a free is a so open source version controller tool version controller is means that it uh control your source code versions means it controls your track down your activity of your source code what whenever you're doing changes git will track down all the changes and will give you the complete picture like who made the changes and what changes have been made and it will install uh if you want to use Git You need to install in your local machine and then first of all you need to install it and it is like a software it is a utility and in other hand GitHub is not a open source first of all it is a Services based company which is like a cloud-based company and it is a providing a interface for collaborating other developers so GitHub is like uh focusing on uh contribution that you can like if you if you have a big project you want to publish on publicly or you want to p uh publish on cloud or Internet you can use GitHub and you can uh upload your source code in GitHub and you can invite other developers also so that they can contribute together and you can guys together work uh on a same project right so it will track down all the activities if there are 10 developers working then it will basically track down for all the activities that who made the changes again so GitHub is a servic that use a g utility so it is like that git is mandatory if you want to use it but GitHub is just a Services there are alternative Services also available like git lab or bit bucket but git needs to be installed on your local machine right first so this is a difference all right so let's understand about uh what is a workflow of the developer so suppose I am a developer or you are a developer you are writing a code in your local machine right what you are going to do that first suppose I have built one project in my local machine and I'm using git first and I will make that changes I will basically do the changes with the help of git and then I will push this code to the GitHub right and publicly or privately privately you can decide on your basis and then uh I will invite developers or developers can also contribute together and then these are the developers going to be do the changes in your project like they will going to deploy and how they going to do that they will create their on copies of your repository they will not going to touch the main repository repositories is nothing it's just like a uh folder you can say that it uh it is a uh kind of thing where you can basically host your code uh that folder are known as like a repositories it's nothing is just like a project or folder and once you receive the notification that somebody has changed something on the project and they want to merch that with the main live project then you have to review the changes that developer made and if you see that it is useful and it is a correct changes that you that you needed then you're going to merge that with the main uh live project so it is like a workflow that uh currently you need to understand we will see everything uh don't worry we will see each and every point from the basic right we will hear right now and we will cover from everything till the March okay so let's quickly install the G on your laptop so go to the official website get download this is the official website you need to go and currently I'm using Windows so let's installed okay so I will first of all will quickly install in my laptop so click on yes and then just click on next next next so let's do that also you need to create a GitHub account if you don't have so it is very easy what you can do that simply go to the github.com and click on uh sign up page and click uh you can create your account so you just need an email address and then it will ask for the OTP and just it will create your new project okay so this uh make sure whatever you are uh creating with the email address make sure you should have to remember it because we're going to use that same email address while configuring up the git so let's see if git is installed now git is installed but let's see if we are able to access or not okay so I will launch the git terminal so that we can configure the git and let me maximize this thing I think that would be perfect so you just need to open a git terminal first of all because we need to set up a credentials which credential so basically G will understand whenever you are doing the changes right so you need to put the credentials so that uh uh when you do the commits it will give you the information who made the changes so we need to inform that who we are right and also when you're basically pushing your code to the cloud I mean the GitHub then this credential is required we need to first of all configure our G with the credentials so the command is simple get config and uh Global then we need to type username sorry for my typing then put your username okay so here we go now we will set up the email address also same command we just need to type the email address I will explain this uh command but give me just one second so that I can first uh set up my own account okay now you can see that we have type git config git config command is used to configure your credentials it used for retrieving the credentials also setting up the credential in your local uh machine then we used a global variable when you are using a global means you are saying that I want this credential for all the repositories that I'm going to create in my local machine but if you have multiple GitHub account right you can use a local variable also instead of global in that condition every time whenever you are basically setting up the uh new repositories you need to set up the credentials so but I just have one account right now so I will set up as a global variable so that whenever I create a new repositories I will basically use these credential automatically so I don't have to set up again and again right so let's quickly check if it is set up I will use a git list command to retrieve the information now you can see here uh we probably have yep so we have username and we have email address so these are the things that uh basically we have set up now we can uh I'm going to close this uh first of all terminal and I will use a vs code so we will start with the project simple project and you can now run G commands from any terminal not with only the uh G terminal you can run any you can launch any terminal like but usually I like a vs code editor because uh whenever I'm just writing a project right I can simply do the changes on my project and I can run the git commands over there so it will be very flexible so you can also like use any vs code editor all right so first of all we will create a new project so I'm going to go to the files and let's create quickly and here I would say nothing but I would go to the open folder here and I will create a new uh folder here so let's type G demo just random things okay now I am in this folder right so I am in this git demo I created a new folder and I will use a terminal also so that I can go to the GitHub uh commands I will go to the uh View and click on Terminal all right so now you can see here we have this terminal here and we have this folder here right so let's see if G commands are working or not so you can use Git Version command to see what is a version installed it is a 2.44 also you can type get help command so get help command will shows up here all the possibilities Vector that you are needed right so it is very useful get help also like uh you can type get help hyph a that that will give you the all the commands that available and you can use these commands so uh anyways we will use these Command right now so do not be confused over here all right so first of all if I type LS here right it is empty directory we are in the git demo folder if I Ty PW and this command is a Linux command you can run Linux command in the vs code code editor also so if you don't know what command I'm running you you can watch my this video which I have created for Linux 60 commands that will give you understanding about what the Linux command is so this is very simple P PWD is like a present working directory and LS means we are listing down the content of this uh folder okay so we do not have any files here and the first thing I would say that first of all we need to check if we this uh this folder is it a g folder or a normal folder so let's type get status now you can see we have one uh message coming up that this is not a g repositories repositories means uh or you can say repo so G saying that it is not repo it is not a git repo and we are not tracking G is not tracking this uh any files if you are going to create any files or you're going to just write any code it will not track anything until you need to initiate as a git folder right so let's first of all initiate this as a git folder so we're going to do that I will use get init command this is a first command when you want to initializing the git folder right so I will use git and in it once I hit this thing it will give us message that initialized empty git repositories okay so now you see here we have dogit folder also available so this is another option also you can check that you can check the ls hyphen a command that will will list down the hidden folders and you will have this uh hidden git folder right so it will basically uh give you the uh all the configurations and like all the configurations and all the commits that you're going to do that it will store in this H hidden folder okay so let's type git status now now you can see this is a git repositories it's uh now we have get status and this is uh Branch name we will discuss branches later but we I'm just telling that this is a master branch and there is no commit yet because there is nothing in this files so there is nothing to be changed or nothing to be added so when you are doing a coding you will do three things always like you are going to create a files you're going to write a code right or you maybe uh edit the file or you might be delete the file right there is three thing so uh in that workflow you will use a G right and then basically use a GitHub also so let's quickly create a new file here I'm going to use index.html and I will write a simple code I don't want to be make a confusion here so let me quickly type hello world and do not worry about this code it's just I'm just taking a example because I just uh trying to explain that how you can use uh git with your project so suppose I'm writing a uh code and this is a very basic code it's like a HTML right I don't want to be this video is for git and GitHub it is not for any coding tutorial so yeah if so this the purpose of making this video is just to understand about git and GitHub commands so let's type now git status now you can see when I type get status uh you probably uh notice that the state plus it's changed and get is get is saying that this file that you have index.html it is untracked git is UNA aware about this file but git is saying that I'm not tracking this uh file right right now because you did not add this file GitHub G is using a four stages of workflow like let me explain you first so there are four types of stages when you are creating a files or maybe you are editing a files or you are basically uh deleting a files right so there are four stages one is untracked unmodified and modified and stages okay so what is untracked means means when you're creating a new file right suppose you have a g repository okay so you addit a new file and in that time G is saying that hey I'm aware about this file you have added but I'm not tracking it because you haven't added this as a git repositories okay you need to tell that git hey git I need this file I can give you one more example here suppose you you are doing the online shopping right and you're scrolling scrolling the uh products right on Amazon and you're not doing any shopping right at that time there is nothing Amazon is not tracking any activities of purchase right once you are saying that hey I just decided these five products I want this five products so let me just first add this product in the bucket I mean in the add to card right once you do the add to card means you you are saying that hey Amazon I decided this product I will use this product uh I will just add this product in my bucket and later on I will uh do the paper okay so when you do the add to the a card it is the same thing in a g git also like uh when you create a new files and then you need to add that files first of all in your bucket that you you you are saying that hey G I want this file but uh later on I will do the commits whether I want or not I will remove also there is options okay but in the same thing once you do the payment on online shoppings right once you have added a file five products suppose and with the five products you are saying hey I just need a four products now I just uh I'm just removing one one product from this list of my wish list okay from this four product I'm going to do the payment right now then at the time Amazon will send you the bill right that uh that is a commit that when you are doing the payment right you are saying that hey I just did the payment and give me the uh com uh just give me the bill right so when you got the bill it is a commitment that you have done the payment right so same thing is in the uh GitHub also and G also sorry the simple thing is when you are adding a new file right it is in the untracked position git is not tracking git is aware but it is not tracking anything you can remove the file at that time also it will not going to track anything but if you want git can track your uh source code when whatever you doing the changes you need to add that file in the uh git okay we will see that how to do that but I'm just telling you you need to add that file in the git and uh you did some changes right you add that file and then you again did some changes and then you need to add that file again and you have to say that hey I'm done with my changes and now I want to commit this thing so once you do the commitment right it is in the stages and then it will be going to the in commit so it will shows as a unmodified okay so first it's like a creating a files it is untracked you add it in the Git it will be unmodified right you modify the file it will showing up like a modified file is modified then it will you need to again add that file in the staging environment then you need to do the commitment and then it will be showing up in the unmodified I know this probably uh looks like a complicated but it is not I'm telling you because I can give you the link of the a documentation you can read the documentation but let me show you in a practical way so that you can be able to understand so we have added a new file here right now uh currently status is showing up untracked now we need to add this file as we want he get just track this uh file so I will do get add and the file name okay so once you type get add and file name then it is change the status it will change the status of this now you can see here this changes has been done it is telling that changes to be committed now you have edit the file and there is nothing's to be uh modified or something and G is telling that are you sure that do you want to do the commitment then it will be change as onst stage currently you are in the staging environment okay I'm saying that okay I want to do the first commit so I will use get commit hyphen M hyphen M used for putting up the commands so and commments why we need to put the commments so commments are very important whenever you are basically uh using a git so git is a version controller right so if you're not putting a commments you will not able to understand what the changes has been made right because it will the git will show the changes with the help of commands so you need to get the commands so that you will able to understand later on or somebody if they are checking if there are 10 developers and uh they are doing the changes and they're putting a commments I can able to understand with the help of commands Okay so you need to put the commands always first commit and adding new files adding new index.html okay so I will put the simple command I hit enter now this you can see on the left side also it was showing up m means modified now it is changed because we did the commit and it is a final step where we uh changed now if I type get status now you can see here nothing to commit working tree clean created a new version of this code and this stored um like a version new version of this code if you want to roll back later you can do that easily we can also check our commits so I can type git log so git log will shows up all the commit commitment I can show you when you type get commit right it will tell you the commitment that you have done and you see not you Pro you probably notice this hashes right so this is a hashes which is a unique hash for all the commits that you're going to do that and this is the uh branches that where you have done the changes right so I done the changes in the master Branch so again I will discuss the branches later but just understand we are in the master Branch where we have did our first commit okay this is the author who did the changes when the changes has been made okay and what the changes has been made it is a commands here that we added over there okay now if suppose I'm going to add a new changes I will edit this file this is a index. HTML I will do the changes again I put the changes uh let's type this is second line okay I will save this code now you can see when I just save this code it telling me that this file has been modified so vs editor is very intelligent whenever you're doing the changes it will shows up as a changes as a modified also if I type get status right now it will show me that this is changed it is like U the file has been modified right it is not in the staging environment now again we need to add this file so I will add this thing and I can type the file name index.html and I can do the second command this new line added in index. STL all right now if I type git status now you can see this m is removed because we did the commitment that uh this changes should be done so git is understanding all our changes let's see git state status everything is cleaned also like uh first check the commitment you can see here this is our this was our first commit and this is our second commit new changes as been Lear okay I can little bit Zoom all right I hope you are understanding about the basic uh staging how staging work okay let's add a new file here suppose I'm going to type Style do CSS okay I created a new file here and I will add this style do uh okay I added this file also and suppose let's type a simple uh let's type color only right okay so now what is done I can first of all save this code okay now you see here there are new file has been uh new file is added and this index. HTML is also added okay so if I type get status here we have let me again type so that you will able to understand get status now G is telling that you have modified the index.html which is you need to be uh add you need to do the commit commit if you want to do the changes because it is not currently in the staging environment second thing it is saying that you have one more file that you recently added but we are not tracking because it is recently added so it is in the untracked stage okay so now I want to add these both file there is one way I can type add and then file name like index. HTML and style do HTML but instead of that if you have multiple files you want to add a multiple file right you can simply type dot so dot means all the files and if I hit enter now I type status you can see get status one file is modified this one and this is added a new file okay now we will do the second commit third commit sorry so this is added added style. CSS file now if I type get status you can see there's nothing to be commit and and these this file is has been added okay so this is how you can basically work with the git So currently we are working on a local repositories okay we are currently working on a local laptop right we are not basically working on a GitHub right so I cannot like contribute with other developers if I want to do that I need to publish my code first on GitHub or gitlab or somewhere then I can invite them so that they will able to uh contribute Al also do the changes okay now let's understand about the branches that is very important topic in the git that is a main purpose of using git and GitHub right let me give you a simple example suppose you have a website you're a developer and you're writing a code on the website you created a website and it is a live website suppose you decided to add a chatboard in your website but I don't want to mess up with my live project so in that condition what you what you can do that you can create your copy of your project I would say that uh you can create a new branch of the main branch or you can this this is a main or Master Branch whatever you're saying Master Branch or main branch is nothing it's just a main one which is like a root branch which connected the live project or you can say which is a main branch and if you want to fix any bug or you want to add any feature right I can create a new Branch branches is nothing it's just like a tree have multiple branches and everyone is every developer is working on their own branches they are creating their own branches and once they have done their work they can merge that to the master Branch then it will show as a project okay it will show as a live project if I want to check what what is my Branch I can type git Branch now you can see git Branch will shows up the current the gr G Branch will show the branches if you have multiple multiple branches it will show here currently I just have one branch because it is a new project I'm not uh I don't have any branch now suppose I want to rename this Branch so you can do that easily I can say that U I want to rename with Master to Main Branch so uh that will be helpful for later also I will tell you but I if I want to rename this master Branch to Main Branch I can use git and then I will use branch hyphen M and then I will type main okay now let's see my Branch name has been changed to main okay so now suppose you want to create a new Branch I want to create a new branch and um I want to add a new feature on that Branch so let's see I will type Branch sorry I will type get checkout hyphen B and then I will type a new Branch suppose I want to create a feature one branch feature one now you can see uh this is a message that you have switched to the new Branch name as feature one if I type get Branch I'm in the feature Branch this uh star means you are in this current Branch okay so if I want to switch to the main branch again I can do that simply get checkout and the branch name now I switch to the I switch to the main branch if I type Branch I'm in the main branch again I'm going to switch to the fature branch okay so let's see now we in the feature one branch okay now in this feature Branch we are in currently feature one branch I would say I will will add a new U line here I will add a new feature so let's say um let's add a simple thing so okay and this is Google Google me so I have added a new line here right it is a new line which is u in the feature Branch we created a feature branch and we added a new feature or you can say new line of code and if I type get status right now it telling me that the Chang is not in stages you are in the current branch is feature branch and you have modified this index.html okay so they are saying that you have modified this file you need to do the commit so let's do the commit again and I will do commit High m and uh new Fe new feature added in feature Branch feature one branch okay so this is a command now if I type get status all right nothing is there now you can see let me show you one thing this is currently we are in a feature Branch okay we are in the feature Branch so we did the changes in the feature Branch so it means that if I switch to the main branch this feature should be removed right because I didn't I don't want to mess up with the main branch so let's see check out I will switch to the main now you can see the feature that we have added recently it is removed now it is not in the uh main main branch okay it is only in the feature if I type feature again feature one now it is added so it is very uh useful and U suppose again I'm typing right it is removed and if I type fature one it is added so this is how you can like create branches uh when you want to do that so you want to add a new feature you can create a new Branch okay and you can do the changes once the changes has been done you can merge that uh changes in the uh main branch now we did the changes now I want this changes which is in the feature Branch I want the same changes in the main branch also so I will do the merge command I will use sorry first let me clear this thing let me see where we are we are in the feature so first let's uh switch to the main branch okay so we are in the main branch now I will use a merge command get get Marge and I want to merge the feature Branch with the main branch so I will use kit merge and feature one and hit enter now here you can see updating this fast and the one file changed and here here it is okay so now if I type get status we are in the main branch and this uh the changes that we added in the feature Branch it is showing up in the main branch also and I can show you also uh okay if I deleted the feature Branch it won't affect the main branch now because the feature Branch features has been added in the main branch so let's delete the feature Branch feature one branch so for deleting you need to type git Branch hyphen D feature one okay now you can see the branch feature one is deleted if I type uh git Branch we have only one and the feature is there okay so I'm saying that I did some changes uh in the feature one branch I uh marched that in the main branch then I deleted the feature one branch it is like very useful now we understand about this workflow right now I want this uh these two files and this entire project to publish on GitHub how we can do that let's jump to the GitHub account this is my GitHub account I will see so you can see here there are options available you can play with this but just click on this and click on your repositories okay now here I don't have any reposit so first I will create a new repo I will give the same name that what I have here get demo so that it won't be conflict get demo so one thing if you're starting your project from your local machine that what we are doing right so whenever you're creating a project you're starting writing a code from your local machine right then you publish on GitHub or somewhere right so when you're starting your uh writing a code from your local machine you need to uh select you don't need to select any options which is like a adding a readme file because it will conflict with your local machine when you uh pull the data okay because I don't have readme file so I will create later on but first thing I will do one thing I will just create a scratch file which is empty file so I will create simply now it is giving us the instructions how to connect this uh GitHub repo with your local machine okay so this is telling that create this thing so I will do later or maybe this is read me file is mandatory so let's do that quickly so first we will add this read me file in our local machine okay so we added this read me file let's add let's do the commit also so commit Hy M added read me file okay so we did the changes now let's go back now they are saying get in it command now we did we already have a project and it is already start started and right so init command only used when it is not started and you want to initialize the project right as a gate repository so we will skip this thing this is already done and this is also we have just committed now they are saying that get Branch hyphen M so I explain this thing when you want to rename your branch you need to use hyphen M and the branch name so why they are saying that may sometime what is happening whenever you are creating a new repo in the GitHub account right so git is creating a default name as a name main okay so they are saying that if you have any another name then you can basically copy this uh name uh you can rename with this command so that it will uh sync up properly so let's see we have this what what is our name of our branch is it is a main so we don't need to run this command Okay so let's do this thing get remote add origin so what is this command so this is a URL of my git repo that I have just recently created okay I'm just setting up this URL origin in my local machine okay so I will use this command I will copy and I will run this thing okay now I can also uh verify this with hyphen V command you can see origin is set for fetching up the information and push to the information so now I have to run this push command so this push command basically will use for pushing up your code from local machine to the remote repositories okay but if you see here uh now I'm just typing get push hyphen o now let's sign up I authorized this thing it will redirect to the application okay so let's see let's wait for a second perfect so now if I go back over this I can refresh my browser all right so go back doing on my repo your repo now I have get demo okay so let's open this and see if we have two files available or not yes so we have these three files available and If I open this thing you can see so the one command is push command it is like pushing up all the goods right so if I clear this thing I can just now do the changes over here and I can run the git push command it will push to the GitHub account let's see again so let's type hyphen 2 I'm just studing this this is test for checking if my GitHub is working or not okay now I did the changes I will save this thing first of all I need to do add let's do the commit and and added new line adding S2 line okay so that I can remember later all right so now you can see I did the commit it will not U showing up here the reason because I did not push this code it is only saved in my local okay I need to type get push now it will push to the main it will push to the GitHub okay so now you can see if I refresh this page here you can see my commit commitment showing up right so if I open this thing index.html here it is showing up S2 and this one okay so we understand about this uh concept and if you see here right we have two branches available I think only one branch let's see I'm not sure I think I deleted the one branch we have just one branch right so it will showing up only one branch let me open it so if I so if I create one more Branch okay it will ask me suppose uh currently we just working um right now I'm just creating my own branches right Suppose there are multiple developer creating a pull request I mean they are creating a branches and they uh merging to the main branch okay uh once they trying to merge that with the main branch which is which is the main one live project it will not able to uh merge until I need to review and I need to accept that pull request okay so the same thing let's see let's create a new Branch Branch b and I will say this is feature Branch or like bug fix bug fix Branch okay so I will add this thing I think I did something okay I need to type for creating a new Branch right so you need to type checkout I types okay now the branch uh the g bug fix branch has been created and if I type Branch where we are we are in the buck fix I will basically push this thing so that uh so they are saying that you need to tell that origin because previously we added a origin as a main branch okay so once you created a new Branch you need to set us Upstream also so I will do Upstream origin and bug fix okay now it will push to the main branch it will create a new branch on repo so if I refresh this thing okay we have two branches one is Main and another one is Buck fix now I will do some changes in here in this uh bug fix and when I try to merge that with the um main branch it will shows up here the pull request okay okay now I will do the changes in my bug fix Branch okay and then I will try to merge that with the main branch let's see what is happening on GitHub so we see that here we try to merge that with the command right get merge command but there is another way also when somebody is doing that we are getting a notification probably here also so let's see how it is working so let me see first of all where I am in which branch we Am branch kit Branch so I'm in a bug fix so whatever the changes I will do here it will not shows up in the main branch okay it should not be shows so I will do simple another G this is bugfix Branch okay I just added a new line symol and I will add this thing quickly and let's Commit This thing also new fix for New Branch okay the changes has been done locally okay we created a branch we created a branch and we added a new line okay it is a bug fix Branch where we have added a new line okay and now if I go to the git push okay let's see what what is happening over here now you can see when I just type get push uh in the GitHub account it is telling that you have one pull request that is coming from somebody's right if I refresh this page also I have this thing I can first of all compare I can basically review this request and then I can if I want to re uh basically I want to do the merge then I can do from here okay what is a new changes has been done I can review from here so they are saying that this bug fix branch is trying to merge with the main branch and they are saying the commands are new fixed for new branches and the changes what are the changes has been done the green line if you see right this is a new line has been added over here okay now basically this is my on changes that I am doing right now but sometime if there are multiple developers working together and you want uh you want to review this project you can put the comments over here and you can basically send back to the developers if you really don't know you really don't need this feature right so in that condition uh that request will send to the developer and then he will do the changes again he will again send a PO request you will review it and you can merge that so currently I'm a developer I a uh PR so let's create a PO request just uh accept this thing changing for the ability now if you want to do the changes uh you can do that or you can put the comments and then probably you can do that so I just do the merch pull request okay and if you want to do some new comments you can do that but I would make the same uh comments that developer right okay so I will simply type the commit now you can see pull request successfully merged and closed this is closed here we have one new fix for New Branch we have in the pull request the code is here and if I just open the main branch we are in the main branch here I open this index. HTML you can see this new feature is added here also so means there are multiple developers working together they can basically work and they can send the PO request to the main okay when they have done their work and then you can review that project and then you can basically um uh March that with the main branch okay this is a concept of using contribution suppose second thing I would like to say here now we understand about from here like we created a project right we did some changes and we added as a get Repository and then get we push that git our project to the GitHub account like then uh we understand about the push Command right from the GitHub and we review the code with the pool request and we merge that also okay so one the once the merch request has been reviewed and approved by the PM PM is like project manager of the project who is the owner of the project you can say that he will review that he will merge that to the main branch okay then it will come back to the main branch okay now this is a one concept we started a project from our local machine what if you probably hear many of the developers and programmers and contributing on uh open source project right so how they are doing that how they are creating a pull request how they are starting doing that because the project is started by someone right how they doing that that is called it folks okay so let's understand that also here is a search you can search anything any project so let's see if uh python okay so this is a open source project I would say the algorithm python uh not this one sorry take any another open source project uh I would say uh Debian okay Debian let's search Debian first this is Debian Dean Dean Dean okay so this is the one which I want to contribute so okay this as you can see this is a project that here showing up six contributor so this is a open source project okay you can contribute on any open source project how they are doing that so you you see here on the left side on the right side they have the contributors they have the contributor that they have contributed on this project they did the poll request and these developers ex uh working on this project okay but 4.6 fogs are also like pulling up this request and they are doing the changes but they are not basically a contributor so how we can do that let's see so this is a project right I want to clone this entire project in my git okay I want to contribute in this project so there is a fork Fork option here you can see fork I can click on this thing and this will create a new fog in my depository you see honor here and I can simply create this thing and entire project right entire project will be shows up in my repository so if I go there you can see everything we cloned from the open source project and I added in this here okay now I want to contribute on this project how we can do that I would say let's say uh let's copy this thing so you can see here code options okay so when you uh basically want to clone everything from the GitHub to your local machine there is a option called code and you need to copy this URL I would say here and let's uh create a new or you can say we are here let's go back okay now we have multiple now let's type get clone okay get clone and type the URL that you copied from here okay when you type get clone and repo I just hit enter it will clone everything in my here right I will see here also I can show you where it is yes yeah so we have this folder here Shadow sock hyphen install I can simply redirect on this folder okay right so we are here right now okay so I will do the changes and I will push to the GitHub account now I I did all the changes I just copied with the one command get clone and I copied everything from the git and I just make it here okay once I will do that I need to first let me just quickly open give me one second this is a folder I will open it okay so the this is a project I want to contribute now I just copied I first click on for I created a one for request and it is uh copied entire my GitHub to the my GitHub account and on and on key log Hyun the project and we have the entire project okay so now I will do the changes over my local machine suppose uh copyright I will I'm just taking example do not do this thing and this is very um unprofessional but I'm just telling you how things work like uh this is just example I will just type in the GYN okay okay now uh I will save this thing I did the save okay now let's open the terminal again let's see what the changes status now you see here we don't need to type init command why we already have the project which is uh we cloned from the GitHub right so if it is on a GitHub it should be a git installed right it is already initialized the G right so we just need to type git status and we need to check what is the status now we just add this file we did the changes so get commit uh random changes changes and hit enter okay so now we did the changes now I will use push command hyph first let's check what is a repo so branch so it is a master Branch so I will use push hyphen U origin and master okay so I will use get push hyph U master and let's see it is asking asking me for authentication okay so let's authenticate first time here you can see we have read me file let's go over there random changes here right one minute changes so uh I did the ches I here I'm here right I I'm here right now and now I want to basically uh create a poll request so I will do the uh open a poll request if I click on this open a poll request okay it will ask me create a pull request but I will not do that because this is very uh I would say this is like um this is not a right changes right this is not uh impacting the any workflow right right so do not do this thing because it will create a problem and um you just uh I'm just telling that that that how you can contribute right so this is a way that you can contribute once you click on click create pull request it will send this pull request to the main one right you can see here this will send to the teddy sum uh which is a main uh open source project and once they accepted this poll request they will this uh changes will reflect on their repo okay that is a main purpose of using a pull request when you want to contribute but do not uh create any random pull request without any doing a good changes I'm just giving you some example how to do that I hope you understand about get and GitHub concept and please subscribe and hit the Bell icon so that you will get a notification when I will upload a new video
Info
Channel: Inderjeet Singh
Views: 914
Rating: undefined out of 5
Keywords: git and github full tutorial - git and github basics, git and github full tutorial, git and github basics, git adn github full tutorial, git and github full tutorial playlist, git adn github basics, git adn github full tutorial playlist, git, git tutorial, git tutorial vscode, git and github for DevOps Engineer, Git and Github for Beginners, git and github, git and github full tutorial vscode, infosecsingh, Inderjeet Singh
Id: _aT_lXVOfCY
Channel Id: undefined
Length: 54min 49sec (3289 seconds)
Published: Mon Apr 08 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.