I usually do a git fetch origin
followed by a git merge remotes/origin/master
, but was getting a Already up-to-date
response. I knew this wasn't true. A git pull origin
worked fine and brought in the changes.
What did I do wrong?
When you did:
$ git fetch origin
you were not getting the origin/master branch. Assume you were getting origin/other. Then when you did:
$ git merge remotes/origin/master
because there was nothing new on origin/master (you never fetched it) there was nothing to merge. You got 'already up-to-date'. As you know, when you did:
$ git pull origin
there was a merge to perform because 'pull' did a fetch (of origin/other) and then a merge (of origin/other). You should be able to see which branches are configured for 'pull' and 'push' with
$ git remote show origin
Fix it with:
$ git checkout master
$ git branch --track master origin/master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With