#15 : Git Commit, Push, Pull, and Fetch | VSCode | DevOps | Azure DevOps

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone welcome back to another session of azure devops training in this one we are going to see how to perform git commit Push Pull and fetch with vs code all right here you can see that into this new repository I just have one file which is readme file okay now I'm going ahead and cloning this particular repository in my vs code now you need to select a folder so I'm going to create a new one new project okay and I'm going to select this folder for the repository destination and then it is asking me whether you want to open the Clone repository and yes click on open okay and Trust the authors now if you are able to see the menu bar on my screen then you need to click on Terminal option and then click on new terminal option okay once you do that this window will open up for you and you can like you know uh like basically resize it okay so for the first time when you're like you know when you have cloned the repository for the first time you have to configure the username and email okay and in order to configure that this is the command that you would be writing so you have to write something as get then config user dot name so I'll move to my Azure devops and I'll check out the username so my username is same as my email ID you need to check your username you might have kept it some as something else and not the email ID so I'll move back to the vs code space and then this and similarly you have to configure the email as well user dot email okay and then click on enter okay so this step you only have to do do it for the first time okay once everything is set up you don't have to configure your username and email uh again and again okay so this is only for the first time now once you have this let's just go ahead and add a file to this repo from here okay so I'm going ahead and adding a file here let's just keep it as test1.html and I'll just add some content here and save it okay so now you can see that in the source control it is showing me that there is one change okay you need to click on here and if you see that it is showing me that under changes we have this file test1.html and it is showing me something as you you means untracked okay so the first thing that we have to do is click on the plus sign that means you are staging the change so click on the plus sign and once you have staged the change the second step is to commit the code okay uh just keep in mind that comment does not mean push I mean once if I click on Commit and if I go back to my Azure devops I will not be able to see this file until and unless I push this file from here okay but let's just go ahead and comment this first and here you can add some comment okay committing test dot HTML okay and then click on Commit now once I have clicked on Commit there are two options by using which you can actually push this code okay either you can click on sync and also you can click on these three dots and you can click on push okay the difference between push and sync changes is that when you click on push whatever file you had as the change that file is going to go and get synced with Azure devops repo but if you click on sync changes let's say there is a new file that is available in the Azure devops so that file is also going to get synced back in your vs code that means sync changes is also doing the work of pull okay so this button will push and pull your code okay but in this case we are only going to push the change so I can click on push here all right so it is done now we can go back and we can refresh this so you can see test1.html is available over here right this is the content that I put now I want to show you that option of sync changes okay for that I need to have a file over here so I'm going to create another file here so let me name it as test2.html okay create and then let's just post put some content over here and I'm going to comment this and click on Commit okay and let's just go back to the vs code Okay so here if so you need to find where is your Source control this is a source control right and if you click on these three dots you need to click on fetch first okay because fetch is something that is going to or you can also click on pull okay let's just try the pull first okay so if I click on pull it is going to sync back all the new changes that I have in Azure devops repo back to this vs code okay if I now if I see the files you can see that test2 dot HTML got sent back okay now I want to show you another scenario let's just go back and add a new file here I'm going to name it as test 3 and let me create one more file I'm just going to come add some random content over here and then I will also go ahead and create a test 4 file okay and click on Commit now if I again go back to Source control and if I click on these three dots and click on pull it is directly going to fetch me all the new files from the Azure devops repo but let's say if I don't want to directly pull all the files but before that I want to see that how many files I am going to actually pull from the Azure devops repo okay for that you can actually click on fetch okay so if you click on fetch so if you see here right besides sync changes it is showing me to that means there are two two new files that are available okay and two new changes you can say so if I click on sync changes then it is telling me this action will pull and push commits from and to origin main that means if you have any new file available here that file also it is going to push and if there are new files available in Azure devops repo then it is going to pull those files into your vs code okay so I'll just click on OK and then let's just go back to the main folder and see so you can see I have the test 3 file and I also got the test for file okay so now I hope that you understood that how you can commit Push Pull and also fetch okay so for committing you can create any new file over here okay let me quickly show you again okay and here is your Source control will start showing it you need to Stage the file and then you need to click on Commit and once you commit once you commit you need to click on push okay let me add some comment okay it's not allowing me so so I've staged the file but let me add some comment here okay uh adding new file and then I'll click on Commit now I can push this so this is done let's go back here and refresh this so you can see the new file that I just created and pushed it is available over here okay so this is how you can basically commit Push Pull and make use of fetch options that are available all right so that's all for now thanks for watching I'll see in the next section
Info
Channel: BracesAndSemicolons
Views: 7,058
Rating: undefined out of 5
Keywords: git commit, git push, git pull, git fetch, how to perform git commit with vscode, how to perform git push in vscode, how to perform git pull in vscode, what is git fetch, commit code to azure devops from vscode, how to push code from vscode to azure devops repo, how to clone azure devOps repo in vscode, devOps job interview questions, devOps jobs, devOps training, devOps course, complete devOps training for beginners, salesforce, apex class, lwc, clone repo, apex trigger, sfdx
Id: eZlBUvAyEFk
Channel Id: undefined
Length: 8min 36sec (516 seconds)
Published: Sat Jan 14 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.