Quickly Push Project From Visual Studio Code To Gitlab Using Terminal And Ssh Key| SSH Key In GitLab

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys so in this session we will see how we can push our project from the local machine to the gitlab repository using the visual studio core and this time we will use the integrated terminal available in the visual studio core so first I will open the project that I want to push so I will open the folder for the project that I want to push okay so once your project is open in the visual studio code just go to the terminal and click on new terminal okay so First Command we are going to use is git init so this will initialize a empty git repository on the local machine So currently if you check the status in that local git reposit there is nothing okay so all these files are not a part of our local git reposit okay so we can do that git add space dot that means I want to commit all the files in this project then I will use git commit let's say nothing to commit that means everything is committed in your local gate repository now we need to set the remote gate repository URL uh to which you need to push this project so this time we are going to post our gitlab repository so I will click on new project click on create blank project here I will give some project name and I will click on public so our project is created now we are going to use the SSH mechanism to push our project from local to this gitlab repository so what we have to do is go to the terminal again first we will add the remote git remote add origin space and here we need to provide the SSH URL of your gitlab repository so click on clone and copy the SSH URL paste it here hit enter so if we try to push directly without any authentication it will give you the error okay let's try that so this is the error we are getting so first we need to add the uh public SSH key in the gitlab repository and private key will be available on your local machine okay so using this two combination public key and private key we will be able to push our project from local to the gitlab okay so first go to the gitlab click on this profile icon and go to the preferences so from here you will find this option SSS keys so we don't have any SSH key added here so I will click on add new key and here we need to add the public key okay so first we need to create the private and public access key on the local machine okay so how we can do that just open the git bash on your local machine so now just run this command SSH hyphen keychain hit enter again hit enter so it is going to create our key in this folder location so I don't want any pass press hit enter again hit enter so now if you go to this location on your local machine you will find two keys over here so open this public key in notepad plus plus and copy this content and in this key section just paste that content okay so I can give any Title Here okay and uses type is for authentication and signing and I can set any expiration date for this particular SSH key okay so if I set the let's say 29th only so this key will be valid only for 29th July after 29 this key will be invalid so I'll click on ADD key so let's try to run the same command again origin Master hit enter so click yes so here you can see all the files are pushed to our gitlab repository now we can pull the changes from this gitlab repository to our vs code AS also using the terminal so first I will make some changes let's say in the palm.x1 file I will do some changes here so I modified this file from the gitlab so I want to commit these changes so I will commit it on the gitlab so pull those changes just use this command git full hit enter okay so there are two insertions and two deletions so we have uh successfully pulled the changes from the gitlab repository to our vs code so this is how you can push the project from the vs code to the gitlab proposity using the terminal with the SSH key thank you [Applause] thank you [Music] [Applause]
Info
Channel: AJ AUTOMATION
Views: 8,458
Rating: undefined out of 5
Keywords: git push, push to github from terminal, push project from local to gitlab using terminal, push and pull from vs code, vs code to gitlab, create and use ssh key in gitlab and vs code, connect vscode with gitlab, vscode ssh key, configure ssh key to push project to gitlab from visual studio code, push project from visual studio code to gitlab, Push Project From Visual Studio Code to GitLab Using Terminal, push project using vs code terminal, how to create ssh key in gitlab
Id: V88powQDgdU
Channel Id: undefined
Length: 5min 34sec (334 seconds)
Published: Sat Jul 29 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.