What's the difference between 'git pull' and 'git fetch'?

Question:

Good afternoon. Please tell me what is the difference between git pull and git fetch ? I use SourceTree, but recently decided to switch to the console Git.

Answer:

git pull is essentially a git fetch command followed immediately by git merge .

git fetch fetches changes from the server and saves them to the refs/remotes/ .
This does not affect local branches and current changes in any way. And git merge already merging all these changes into the local copy.

More details .

Scroll to Top