GitLab Beginner Tutorial 2 | Getting started with Git Commands

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello and welcome I'm logoff and today we are going to learn how to get started with gate in other words we will download installed it and then add our project to dit and finally push to get lab so this is going to be very easy and very interesting and if you have no prior knowledge on git do not worry I am going to go very basic step-by-step and we'll start from scratch and you can follow this on Windows or Mac operating system so we are going to download install git add the project or a folder to get and commit and push the project to get lab so let's get started and here step number one will be we have to download and install kit so download and install get on your system so you can go to your system I'm on Windows I will also show you on Mac so here I will just go to get SEM search for get SEM on Google and you will get to this get SEM com just go here and here you will find option to download get now this detects your operating system so I am on Windows it is showing me for Windows if I will go on Mac and just go to the same site and I'll go here get SEM com so here you can see it is giving me the option to download for Mac so if you are on Windows you can download for Windows and if you're on Mac you can download from for Mac so I will say download get from this website and then install it and all these nodes will be available to you in the description or notes section of this video so I will click on this download for Windows and this will start the download and it is exe file I will go to my downloads folder and here is my eh file I will just double-click this to start the Installer and say next you can read all the License Agreement and then say next I will keep it on my default location that is C program files get say next and then again you can keep all these default values and here you can see all these options so I'll just use as it is and say next so here you can see if you want to use get and get bash or you can use this just keep the defaults and say next and next and now I will click on install this will install and get on my system and the command to check so this is step number two and in fact you can also check in the beginning if it is already installed so I will show you the command that you can use to check your gate installation so this is check it is installed on your system and the command is get space - hyphen version this is - - version so this is installed once kit is installed you can go to your command line or go to git bash so here let me see if I have a good vest you can see I have got a good bash as well I can go here and if you run the command get space - hyphen version you can see I am getting the version of get now you can use get from this kit bash or you can also use from your command line so if I exit from here and I will go to my command line or command from and here I will say get space - - inversion and I'm getting the version of kit installed now in case you are on Mac you can go to your terminal and just say the same command it's this - - version now on my Mac it is already installed if you are using Mac and you have not yet installed gate you can just use the same procedure or if you still need some help you can go to my website that is automation step-by-step comm and when you go to online courses you can find our course on git and github so you will find it here under version control system and if you click on this it will take you to my YouTube playlist on git and github and here you can see our tutorial here getting started install git on Mac there's also a Windows tutorial but if you are on Mac you can see this I will also copy this link and make it available in the notes for easy reference so I will create a references section here and this is the link where you can get all those videos so we have done first two steps now here step number three will be run following git commands so now we will run some git commands now in the earlier session we had already created a repository on github so if I go to github.com so this we had done in the earlier session and we had created our account on gate lab so if I open my account I will sign in so we had created an account and we had also created our project on get lab so now we will add run some commands and these commands are the first command I will run is get config - - global user dot name and here you will provide the username that you have used in gate lab so the username that you have used to login in get lab I will provide it here so I will say here get config - - global user dot name and this is my username on get lab and hit enter so by this on the system it has registered or stored this get username so it will not ask you the username always when you are doing a commit and push so we can just configure all this one time now if you run the same command without the username it should show you the username that is added so if I run this command git config - - global user dot name it is showing me the username so that means now it is added so you have to run this command and then run this command just to check the username is added similarly the next command that we will use is we will say you get config - - global user dot email and provide the email that you have used on get lab so here I will say user dot email and I am just giving my email that I have used for creating an account on kitc lab and hit enter and again if you run the command without giving the email it should show you the email that is added and this is the email added so this is the command after adding you can run this to check the email added then you can also run a command like git config - - global and - - list now when you run this command it will show you your username your email and we'll also show you your password so by learning this command you can check all your settings and all the values that you have set so this is the third step now after this step number four will be and this will work exactly same on Mac you can just go to your terminal and you can run this so on Mac if I say get config - - global user dot name and sorry this is config so you can see it is showing me my username here as well so the same commands will work on Mac so we have done this now step number four will be create a demo project or a folder so a project also is a folder where we have like project files and other things so we will create a demo folder and then we will add to get so I'm going to go to my Windows System and I will go to this projects folder let me create a new folder here I will name it good lap go inside this and again create a new folder here and this I'll name it my first project you can name it anything so I have created a folder here now this is the folder that we will add to get and then we will finally push to get lab so here the commands that we will use is so the first thing is so this will be step number 5 go to command line or you can go to terminal if you are on Mac or you can also go to get patch anything will work so this is command line or terminal or git bash and CD or change directly to the location of the folder and run following commands so here we have to go to command line or if you are on Mac you can go to terminal or if you have git bash you can also go to your git bash for now I will open my command line on Windows and go to the location of this folder so I can copy the location from here and here I will say CD and paste the location and hit enter and I am on this location now now here justic here if you are on any other drive other than C then you first have to switch to that Drive so in my case I was on C Drive and my project location is also on the C Drive so I could directly say CD and the location of my project or the folder if you are on some other drive you can first change to that drive for example if you are all if your project is on a folder just say e colon and it will change to E and then you can the location on a jive so for now I will just continue with this so I'm on this folder location a shortcut can be if you go to your folder and go to the address bar and here say CMD on the address bar say CMD and hit enter it will open the command line on the same location we are your project folder this so this is a shortcut that you can use alright so now i'm on my project locator on my project location on my command line and here to start gate or to start tracking this folder with kit i have to say so i also need to go inside this my first project let me go here or as well that is a mistake i should go inside my first project folder and yes now in i am inside my project folder so the first thing you will say is get in it this is the command to initialize it and you can see it says initialized empty git repository here if you go inside the folder you will see a hidden folder called dot get created if you do not see this you can go to a view and say enable hidden items so once you view and enable hidden items you will see this dot get hidden folder created if you're on Mac it will be the same command so for example let me just create a folder here I will create a folder called get lab and create a folder called my first project and here on command line I will CD to this location of my folder and I'm here and now I will say get in it and the same message I am getting here if I go inside my folder you can see a hidden folder if you do not see the hidden folder just press command shift + dot on your keyboard so if you press command shift dot simultaneously you will see the hidden folders here alright so this is the first command that you will use get in it now once you have added your project to get using git init command then the next command we will use is just say git status and this will show you you are on branch master and there are no commits yet so we do not have any changes or any files in the project to commit so let us go to our folder and let me create a file here I will create a simple text file and let us say this is readme dot txt and now if you go back to your command line and say git status now you can see it says this is untracked file readme dot txt so this is the second command git status and you can add some file to your folder and then say git status now after this we have to add this file for that you can say git head and the file name that is readme dot txt now here if you have more than one files or multiple changes to add to get you can just say get head and dot this will also work this will add all the untracked changes or all the unchecked files so I will say git head dot and now if I say git status you can see now it is showing in green that means it is now added and it is ready to be committed so you get head dot is the next command that you have used now we have to commit our changes for that the command is git commit - M and give some commit message here so here I will say get commit minus M and I will say my first commit now here in the commit messages you should always give some meaningful messages so that it is easy for everyone to follow so I will just say get commit minus M and my message and press enter and you can see this committee is now done so commit is done now if you go to your github gitlab repository if you go to your project you will see no changes are here so you can see still it is like same there are no changes here and that is because we have just committed our changes we have not yet push the changes or we have not yet added anything to our repository and for that we have to use a command git push so I will say git push and you can say - you origin/master or in place of origin you can use the URL of your repository so here I will say git push - you and I have to give the URL so you can just copy the URL from the address bar or if you click on clone on your project on get lab you will see clone with HTTPS and you can copy this URL so I will put this URL you can put in quotes and then the branch name is master so as of now we will have a single branch called master if you have more branches you can add to a different branch we will learn that later but for now I will just say git push - you URL and master and I will hit enter and let us see what happens now so this is asking me for my gate credential so let me use it so this is for gate lab so if you are asked just give your username and password it may be for the first time and now you can see it has pushed all the changes 100% done and everything is done now if you go and refresh your repository on get lab you should see your changes here so now you can see the changes are here if I see here this is readme dot txt file here it shows my first commit which was done two minutes ago and now we are able to add our project and changes to get lab so this is step number six check project or files or changes added on get lab so this is how you can use gate and commit push in change push and pull changes to get lab we will also see more commands in the coming future and this is the beginning and in the coming session we will see more on forking project creating branches using git LeBron or CI CD and many other things so I hope this all was very useful for you please do hands-on and also share your knowledge with others if you have any doubts or any questions please read write them down in the comment section below and I will try to and say you as soon as I can I hope all this was very useful thank you so much for watching
Info
Channel: Automation Step by Step
Views: 479,364
Rating: undefined out of 5
Keywords: git commands, how to use git with gitlab, git beginner tutorials, git tutorials for complete beginner, how to create project with git, how to do git pull and push, git commands for beginners, git and gitlab integration
Id: OWaZXtgq28c
Channel Id: undefined
Length: 20min 22sec (1222 seconds)
Published: Mon Sep 23 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.