SAGARFIVE

1. Introduction

2. Git Basics

3.  Git Terminology

4.  Git Branching

5.  Git - Github

6.  Git Add (Git staging)

7.  Git Commit

8.  Github Advanced

9.  Git Remote

9.4 Git fetch vs Git pull

  • git pull = git fetch + git merge  
git fetchgit pull
Fetch downloads only new data from a remote repository.Pull is used to update your current HEAD branch with the latest changes from the remote server.
Fetch is used to get a new view of all the things that happened in a remote repository.Pull downloads new data and directly integrates it into your current working copy files.
Fetch never manipulates or spoils data.Pull downloads the data and integrates it with the current working file.
It protects your code from merge conflict.In git pull, there are more chances to create the merge conflict.
It is better to use git fetch command with git merge command on a pulled repository.It is not an excellent choice to use git pull if you already pulled any repository