GIT with VSCode | Clone, Commit & Push | Git Commit & Push with VSCode | GIT Clone, Commit & Push

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome to my channel and in this video we are going to learn how to use get using vs code so in today's video we will see how to do git commit and get push for our repository so for that i have opened my vs code it is an empty vs code i don't have any project open as of now right and in my git repository i have created a git project so my project name is test project and i want to clone it so before doing commit or push you need to have your git repository in your local so to clone it just click on here and copy this url just copy this url go back to your vs code and over here in this section source control so in this uh in this section you can see the source control just click on here and you will have this option clone repository so click on this and enter your url so clone from url you can select that okay and it will ask you where you want to save i will save it in my git folder and select repository location and it will be saved over there and then it it asks would you like to open the clone repository so click on it and it will open the clone repository in an another vs code window so you can close the old one and this is our new vs code window with our new vs code repository so now as you can see i have this readme file which was there in my repository as well and i don't have any other files so let's create a new file so that we can commit and push it so create a new file we will name it test dot html let's say our file name is this and we'll say hello world okay so this is my html file very simple file and i want to commit this file to my repository so make sure that you do this step because before committing you have to configure git in your local so to do that you have to go select this vs code and go to terminal so to do that on the top you will see terminal so it might not be appearing over here but you should see this terminal option and in this you have this new terminal option right so select the new terminal option and you will see this terminal option so you can you will you might see it at the bottom so you can like drag and drag it over here right so i will keep it over here right and then you should say get config and user dot name so you have to set your username and user email id for your git repository right so my username is richard0305 and my user email is at gmail.com and i will just and we shouldn't change this to email right and this this i'm setting only for local if you want to set it for global all you have to do is after git config you have to say dash dash global this will make sure that this repos this config configuration is set for all your repositories because i don't want to set it for all my repository i just wanted for this repository i will not say global over here and i'll set it like this and just enter and your username and email id is set so this you have to do for the first time after that you can commit and push without doing this configuration so now let uh let's go here and you can see that it says you humans untracked so we can add it and once you add it it's converted to a means it is added in git and now you have to commit so before committing you have to give your commit message over here so let's say added test dot html file so make sure that you give a relevant commit message so that other people who are using your git repository maybe your colleagues they should understand that what did you push in your uh in the git repository right so they would be able to understand it properly so make sure to add a meaningful commit message over here and then over here we have this tick mark which is for committing your code so just click on it and your code is committed now once it is committed you have to push it because just committing will not get your code over here so if i refresh i won't be able to see my test.html file so to see that all you have to do either you click on sync changes or you can do push so the difference between these two is when you click on sync changes it will first pull from your repository it will first pull from the remote git right and then push it right so sync perform pull and push both whereas if you do push only it will only push your changes to the uh remote repository so it is better to do sync because you want to be uh in sync with your remote repository so let's click on sync changes and it will say this action will push and pull commit to and from origin main so this was the branch which was created when we created our repository so we are fine with that so let's just click ok and it will push our changes to the remote repository in this main branch so if i just refresh you can see my test.html so this is how you do commit and push now uh this git config is not required now let's see i add one more file let's add one more file and i will say hello dot html right and in this or also i'll say hello simple file and now you can see this is converted to you right because it is untracked and i can go to my source control add it into git and then give a comment add at hello.html so this time you don't have to do any configuration because it is already added and then you can commit it and you can sync changes same changes and it should be available in your remote repository remote repository you can see hello html is available now okay so this is how you do get commit and push in the next video we will see how to create a new branch how to merge your changes and how to resolve git conflicts as well thank you so much for watching bye
Info
Channel: Harsivo Edu
Views: 73,563
Rating: undefined out of 5
Keywords: git, git tutorial, git tutorial for beginners, github, git with vscode, git vscode, git commit, git clone, git push, git clone commit, git clone commit and push with viscode, git commit and push from visual studio code, git commit and push with vscode, git commit vscode, git push vscode, git clone vscode, clone commit push, clone commit git
Id: lYiE5lBS13E
Channel Id: undefined
Length: 6min 55sec (415 seconds)
Published: Wed Jan 26 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.