How to Push Project to GitHub From VS Code| Pull code from GitHub to VS Code| Push & Pull in VS Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys so let's see how we can push our project from vs code to the GitHub repository so on my local machine this is the project we are going to push so this is a my own project so any other project which we need to push from vs go to the GitHub repository what you have to do is you need to get all the files in a folder first okay so currently I have all the files available in the uh same folder but in case if you have multiple files at different location uh first thing is get all those files in a folder okay so we need to import that folder into the vs code and then we can push that to the GitHub repository so first let's see how we can open that project in the US code and then we will push that project to the data proposity so go to the file click on open folder then go to the location where that project is available then click on select folder so all the folders subfolders and all the files in that folder will be open in your vs code editor so let's close this window so now let's first create the GitHub repository so sign up on the github.com and login into your account then click on this plus icon click on new Repository so you can provide a repository name here so I have given name as my vs code project I will keeping this as a public repository so that it will be accessible to anyone and directly click on create reports So currently this is a empty repository so in this repository we are going to post our project which is available in our vs code okay so for that purpose first copy the URL from here or same URL you can get from this https just click on that and copy this URL now go back to the vs code then click on Source control So currently we do not have any local repository local git repository in the project okay so we need to create a empty git repository first so we can click on initialize Repository okay so if you go to the local machine this dot git folder is created which is a empty one as of now so we need to push all these files first into our local gate repository and from there we need to commit uh and push to the GitHub reposit So currently all these files are not a part of our local gate repository so first we need to commit this into our staging area Okay so click on plus icon here okay so all these files are into this staging area now so now we can commit all these files into our local git repository so here we need to add the commit message first let's say my okay this is my commit message and you can click on Commit okay so all the files are committed into our local git repository so we just need to post those uh files from local gate to the remote Repository so now click on these three dots here then go to the remote and click on ADD remote okay so first we need to add the our remote repository information so I will we have already copied this URL right so I will add it here click on ADD remote we need to provide the remote name here hit enter okay so remote has been created again click on three dots okay so you can directly use this option pool post clone over here okay so before using this option you will get error okay so if I try to click on push it will give you some error okay so I will show you how to overcome this error as well so as of now just click on three DOT first go to the pool and push and click on push to so here I will have to select the which remote gate repository I want to push this project to okay so currently we have only one remote gate repository right so I will click on that so for the first time it will ask you to enter your GitHub username and password for authentication so I have already authenticated this so it has not asked me any username and password authentication now go to your remote GitHub account and refresh this repository page so you can see here all the files from our local git repository are available into our GitHub repository now so now we can make any changes to your local files and you can directly push those changes to your remote repository so for example in this file I will I will add some comment here okay save it again go to the source control so it is showing one file has been changed so I will click on plus icon so this file is available in our staging area now okay so give some message here you can directly click on Commit and push okay so again it is going me that error so I will again go to the three dots pull and post and click on post to select that git remote and within few seconds our changes will be post our remote repository so okay and same we can pull the changes from this GitHub repository to your vs code as well so I will edit this file first changes from GitHub commit changes okay so I want these changes to my vs code project okay so I need to pull the changes from the GitHub right I can fetch it and I can merge it or I can directly pull the changes okay so if I directly try to use this option pool again it will give me the error okay so in that case what you can do is click on three dots again go to pull and push and click on full form okay again select the remote select the branch from which you need to pull click on the master and within few seconds changes should be available over here okay so this is how you can push your project from vs code to the GitHub and you can pull the changes from the GitHub to your vs core project okay so to enable all these options to be used directly what you can do is I will uh click on this icon publish branch okay if I click on publish branch that means it will set our remote reference to our local reference okay so I have published my Branch so I can directly let's say second okay so I have made some changes into this file from the vs code so I'll give the third commit okay so I can now directly use this commit and push let's try yes I would like to Stage all the changes and commit them directly click on yes so now it has not shown me that error it was previously showing right as we have published our branch so let's verify that okay so changes are available here so again let's try to make some changes from the GitHub commit changes go back to the vs code so this time instead of using this uh pull form I will try to use this pool directly so as we have published our Branch it will directly pull the changes so this is how you can push your project from the vs code to the GitHub reposit thank you [Applause] [Music] thank you
Info
Channel: AJ AUTOMATION
Views: 6,855
Rating: undefined out of 5
Keywords: push code from vscode to github, how to push vscode to github, How to push code to GitHub from Visual Studio 2023, How to commit and push in Git using Visual Studio Code, git pull push vs code, How to Push Project to GitHub From VS Code, push project to github from visual studio, push project to github, push project from vscode to github, how to pull from github in visual studio code, pull code from github to vscode, how to push visual studio code project to github, Pull in VS Code
Id: ZkezhL3-6_k
Channel Id: undefined
Length: 8min 20sec (500 seconds)
Published: Wed Jul 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.