Git Fetch vs Pull: Different Results, Not Sure Why

I usually do git fetch originwhat follows git merge remotes/origin/master, but gets the answer Already up-to-date. I knew this was not true. A git pull originworked fine and made changes.

What have I done wrong?

+5
source share
1 answer

When you did this:

$ git fetch origin

you did not receive the origin / master branch. Suppose you got an origin / other. Then when you are done:

$ git merge remotes/origin/master

because there was nothing new in origin / master (you never brought it), there was nothing to merge. You have "already updated". As you know, when you did this:

$ git pull origin

, 'pull' (origin/other), (of origin/other). , "pull" "push"

$ git remote show origin

:

$ git checkout master
$ git branch --track master origin/master
+1

All Articles