In this blog post, we will learn about the difference between the get Fetech and pull commands, which are commonly used when working with a centralised code repository like Azure DevOps, etc.
Consider the scenario. Our code repository is hosted on Azure DevOps, and we are using code editors like Visual Studio or Visual Studio code. We need to use the following commands, either through the command line or using the visual options available in our code editor tools.
Scenariowhen you want to see what changes are available in the remote repository without merging them into your working branch immediately. It's helpful for reviewing changes before deciding to incorporate them into your codebase.
In short, use "git fetch" when you want to see the new changes in the remote repo but don’t want to change your local repo yet.
Git Pull:The "git pull" command is used to fetch changes from a remote repository and automatically merge them into your current local branch. It is essentially a combination of "git fetch" and "git merge."
ScenarioWhen you want to quickly update your local branch with the latest changes from the remote branch, you are fine to merge them into your working branch after verifying the changes and knowing any implications.
In summary, use "git fetch" to just see the new changes from the remote repo, and use "git pull" when you are ready to add those changes to your local repo quickly. Choose what’s right for you at the moment.