The git fetch command imports commits from a remote repository into your local repo.
The resulting commits are stored as remote branches instead of the normal local branches that you’ve been working with.
This gives you a chance to review changes before integrating them into your copy of the project.
$ git pull <remote>
Fetch the specified remote’s copy of the current branch and immediately merge it into the local copy. This is the same as git fetch <remote>
followed by git merge origin/<current-branch>
.
$ git pull --rebase <remote>
Same as the above command, but instead of using git merge
to integrate the remote branch with the local one, use git rebase
.