What is the difference between git pull
and git fetch
?
The git fetch
command updates the remote tracking branches in a repository. In other words, it pulls the latest versions of the remote repository’s branches without applying any changes to local branches.
The git pull
command performs a git fetch
and then a git merge
or git-rebase
on the current branch in the local repository. In other words, it updates the repository’s remote-tracking branches and then brings the current local branch up to date with its remote version.