Part 6 | Git Pull | Git Fetch | Git Merge | Git with IntelliJ | No git commands

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone welcome back to my channel tasting mini which I am your friend amudham shaktive and in this video we are going to learn about get pulled right uh git pull is basically involves two process right one is fetch and git merge right uh we are going to understand this in detail but for now we can take a look at this particular diagram that we have been referencing so far if you haven't watched the previous videos I would highly suggest please do watch them before watching this video right good so now let's say uh we have dealt with you know moving our code from uh our working copy to the staging area and to the local repository and we have also uh pushed our code to the remote repository but let's say if you are Developer if some of other developers in your team have pushed some latest changes and you want to get those changes into your working copy because uh you know you are relying on some of their code okay maybe you both collaborating together and that's what the purpose of Git it it makes collaboration much easier right so so you are dependent on one of your developers code and he has pushed his changes to the remote but that particular change is not yet available in your local repository or in your workspace right not available in this white area so what do you want to do so there are two things that you can do you can do a git fetch which will fetch all the comments all the details about the remote branches and everything into your local repository but it doesn't touch your work working copy right let's say if you also need the changes to be in your working copies uh let's say some of the you know you are you might be working on something else right so and then if you do a git pull uh it might affect your work it might change the existing files right it might also uh you know introduce merge conflicts so in those cases you can also use git fetch kit fetch will only you know pull the changes to the local repository whereas git pull command will basically pull it to your workspace so uh again uh fetching the changes from the local repository to the workspace is called as merge so you can you can basically say git pull is a combination of Fetch and the and the combination of merge so fetch plus merge is full so we are going to understand this in detail so don't worry if you don't understand any of this right so again what is a git pull git pull is basically done to get the latest changes from remote to the working copy right it's basically a combination of switch and merge right let's take an example so this is a project that we are currently working with so what I'm doing uh you know instead of creating a new GitHub account pushing the changes by comment what I'm going to do is do a quick hack let's assume this is a change that is done by your one of the other developers right I am directly doing it in the GitHub viewing right so you can also write your code here but you know writing code and remote is is not recommended because you know you cannot leverage your uh you know Ides that that gives lot of power to your code right so this is an example so I'm just trying to directly commit into the master Branch you can also create a new Branch but we we haven't understand about branches yet so you know let's directly convert this to the master branch so all you have to understand is somebody else have coded this and you are relying upon this to make your you know uh changes so you have to fix these changes if I go to my uh stuff so this is how it is uh Let's do let's make this clean I did some uh changes so let's do a roll back so all is good now right there is no no changes here right everything is good if you open this file this is how it was right you have three sections create energy commit and get pushed and there is a test section I want to get right so how do you do that so first the easiest way is basically do a git pull right or you can do a git fetch first so let's do a gate phase so notice get fetch is successful then this is the command that you used you can also see the commands here but if you are not interested in comments as long as we use Intel J right so it fakes the code but if you notice the test is not it reflecting in the readme.md right because it will only move this to the local repository and not to the working copy this is my working copyright so in order to get that as I already mentioned we need to merge those things so get merge so this is my master branch in my local repository so there is new changes coming from origin Master which is my remote right if I do a merge now so if you notice uh there is one one new comment that happened which which I actually did two minutes ago in my UI so this test is now getting reflected here let's also do one more change and then this time uh let's do a git pull directly right so if you go here I want to get the latest changes from the remote I do a git pull origin master and then if I do a pull now so if you notice this one two three is now reflected so instead of two step process git pull uh is just a one process where it make the changes from your remote to come to your local repository right you can always see the commands that it uses in the show gitla console I can go and see all these changes here right so git pull uh hyphen if you know stat again this is not needed this is an extra verbose command you can just use kit pull origin Master but again in if you are using IntelliJ you don't have to worry about any of that as long as things are working fine right I hope you find this video useful if you like the video please do like the video and then share it with your friends I'll see you guys in another great video
Info
Channel: Testing Mini Bytes
Views: 7,627
Rating: undefined out of 5
Keywords: testing mini bytes, amuthan sakthivel, testing, sdet
Id: 5B-EYSYlg1s
Channel Id: undefined
Length: 5min 53sec (353 seconds)
Published: Tue Feb 28 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.