git fetch doesn’t update my local repository

When you fetch you get the remote branches, but you still need to merge the changes from the remote branch into your local branch to see those changes.

After fetching, try this:

git log origin/yourbranchname | head
git log yourbranchname | head

Do you see the difference?

Now do:

git checkout origin/yourbranchname -b newbranchname
git log newbranchname

You should see remote changes in the newbranchname.

You can also merge those changes into your branch with

git checkout yourbranchname
git merge origin/yourbranchname

Leave a Comment