Few days back, Amitoj asked me why doesn’t git fetch deletes the changes that are not present on remote but are present in local, when it does updates other changes. To explain it one need to understand the difference between git fetch + merge, git fetch + rebase and git pull and why we need to merge or rebase after a fetch and when? I tried searching for some good resources to explain the difference but I didn’t find anything good. So I thought of writing one.
First of all have a look at this image by Oliver Steele.