How to Clone, Branch, Commit, Merge changes using VSCode to GITHUB #vscode #devopstutorial #devops

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi hello vanakkam and welcome back to our YouTube channel today in this video we have an exciting topic to discuss that will Empower us with essential git technique using visual studio code have you ever wondered how to efficiently collaborate on projects using it well we have come to the right place and today I will take you on a step-by-step Journey demonstrating the entire process of cloning a git Repository creating a branch making changes and ultimately creating a pull request to merge those changes back to the main branch and throughout this video we will explore the powerful git integration within Visual Studio code and here you are seeing the visual studio application and we will witness how seamlessly we can manage our source code and collaborate with fellow developers all within the comfort of our favorite code editor so before we move on to the video this is me again I request you all to subscribe to our YouTube channel if you have not subscribed yet like share and share your feedback in the comments section so we're going to see these steps one by one the first one is cloning the get repository in Visual Studio code and then branching the repository in Visual Studio code and then make the changes and once the changes are done we will commit the changes and then we'll create a pull request and then merge the changes in the GitHub so first let's go to the GitHub and we will take the GitHub URL and then we can clone it in the visual studio code and here is the GitHub which we are going to use for the today's demo and under code we will copy the https URL and then we'll go back to the visual studio code so the first step today as we discuss we are going to clone the repository in vs code and for cloning the repository you'll have to go to the source control first and then we can either click on the Clone Repository and here it prompts us to provide the repository URL or pick a repository so so since I have already copied I'm just pasting the GitHub URL and so here you can see it's telling us to clone from URL and we can either click it or we can do an enter so I'm just clicking on the folder and it will ask it will ask us to create a folder in our mission so this will create a temporary storage in a machine or it this will create a local setup in our machine so we will create a folder and we'll save the code in the folder in our mission so let me go back go to this C drive and then to my folder and then to the new folder so let me just select new folder and I'm clicking select s repository destination and here you can see the message which tells us that it's cloning the git Repository and let's wait for few seconds to get it completed and then once the cloning is completed we'll get the prompt of would you like to open the Clone repository and you can click either open or we can open it in a new window so let me click on open in new window and this will create and I'll just show it as show the repo in a new window so if you click on open so that well that would have opened the repository in this old window so let's now use this and here we can see the same code whatever we have we have in the GitHub so we'll have everything the same from the github.com and then so let's see what are or what are the change that we're going to make and before that let's again go back to the source control and we will create a branch so here under the source control we can see multiple options the comments the comment details the file history the branches the remotes stashes Stacks work trees search and compare and today we will see how to Branch so let's go to the branch and under Branch so here we can see there is only the main branch so if you see here there is only the main branch under the GitHub so let's go back to the visual studio code and we will create a new Branch so for creating a new Branch we will have to click on this plus button and this will create a new branch in Visual Studio code and this is again a local branch so this will not get reflected in the github.com until we push or until we sync this change to the github.com so first let's create a new Branch so this is going to be future feature update test data and then we'll have to press enter to confirm so I'm clicking on enter and then we'll create the branch and when we refresh so automatically we can see here and we refresh it we have got the feature update data that's that is not been published yet to GitHub so what we'll do now is let's switch to the branch so until we switch to the branch any change will make will that we make will be in the branch that we are doing it so we have to make sure that we are in the right brand so here we can see now we are in the main branch so now we have to go back to the feature branch and now we are in the So currently so here we can see the current branch is the feature Branch so now let's again go back to the source control then let's open the file and open the file let's go to the Explorer and under the Explorer let me go to the bin and then under the bin we'll go to the create test login and this is what we are going to change the login test data so any any changes we can make but for this particular demo or for this example I'm going to just add few more values so it's going to be 16 17 18. 19 and 20 so these are the values which I'm going to add and once we add all these values we will go to the file and click on Save and this will save the changes locally so all these changes are made locally and after we make a change we'll get a prompt here we will get a notification something like what we get in Facebook or Twitter or any other social process so this will throw us a notification that there is one pending change that we have to commit so now let's click on this message and here I will add a commit message which is updated test data and then we have three options we can either do just the commit or we can commit and push or we can commit and sync or we can do a commit and create pull request so for this example I'll just click on Commit and then we get a prompt that there are no staged changes to commit would you like your changes would you like to Stage all your changes and then commit them directly so before that I will show you one quick thing so here we are in the terminal and for opening this terminal we'll have to go to view and then uh to The View and then click on Terminal this will open the terminal window and here we can see by entering git status so this will show us that this particular change that is you can click enter so git status so this will tell us that we have made the changes to this file but this is not committed or this is not added so what we'll do now is let's add the file so I'll give a command that is git add space Dot and this will add the file and when I do a git status again so here we can see this file has been tracked now so this has been tracked so now if we go and do a commit we don't get the message that we get previously so I'm clicking on Commit and here you can see the previous message that we have got before we add the file so it's not popped up now so now the changes is committed and when we click on get status so here we can see on Branch feature update test data nothing to commit and the working tree is clean so which means the changes has been committed and now let's click on publish Branch so this will publish the branch to the GitHub and here we can see two prompts that is whether we would like to periodically run git fetch or we can even directly create a pull request from Visual Studio code so let me click on refresh and now we'll go to GitHub so in GitHub so we can see the feature update test data with the changes so let's click on compare and pull request and here if we click on pull request automatically our changes will be merged but before that I would like to show you one quick thing so if you click on the pull request and here if we again click on it we can see what are all the changes that we have made so if I click on the commit and then here we can see these are the changes that have made so so to this particular Branch so in case if you have any doubts or if you want to check it we can just do a check like this then let's go to the pull request here and then look compare and pull request and then this is going to be your message the Apple request and then when we click on create pull request so this will create a pull request and then I'm going to merge this build request so in case if you have a reviewer in your project whom you want your changes to be reviewed you can automatically add your reviewers here with this name then once they approve it automatically the changes will be sent for for merging so now I'm clicking on pull request sorry the merge then I'm clicking on confirm merge and once we merge automatically the pull request is successfully merged and closed and I am now deleting the branch so let's now go back to the code so now we have just one one just the simple Branch then if you go on Main create test login and then the login.test okay we can see what are the changes that we have made is safely merged with the visuals with the latest Branch so this is how we are supposed to do clone the repository then Branch the repository and then we make the changes we then added the file and then we committed the changes we then created a pull request and then merge the changes so with that we come to an end and I believe this video would be very useful to you so until I meet you in another interesting video it's my way from Ascension and Little's law
Info
Channel: Littles Law
Views: 4,036
Rating: undefined out of 5
Keywords:
Id: bHUMfiPspXA
Channel Id: undefined
Length: 12min 15sec (735 seconds)
Published: Tue May 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.