0
$ git fetch origin master From https://github.com/haolly/UGUI_learn * branch master -> FETCH_HEAD $ git checkout master Already on 'master' Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded. (use "git pull" to update your local branch) $ git merge master Already up to date. 

I do not want to use git pull, so I use fetch/merge, but I can't merge the upstream to my local branch, as you can see, there are 2 commits I need to merge

3
  • 1
    "I do not want to use git pull". Why? That's how you get the latest changes... Commented Oct 8, 2019 at 1:54
  • 1
    @ObsidianAge because git pull = git fetch + git merge, I like to do it manually Commented Oct 8, 2019 at 1:58
  • What version of Git are you using? Did you create this clone as a single-branch clone, and if so, with what branch names? (If you're using Git 1.7, you must not add master to your git fetch command: this suppresses the update of origin/master. This is fixed since Git 1.8.2.) Commented Oct 8, 2019 at 1:58

2 Answers 2

5

Not sure why you don't want to use "git pull". But you probably want:

git merge origin/master 

git merge master (when on the master branch) will attempt to merge your local master branch with itself

Sign up to request clarification or add additional context in comments.

Comments

2

To merge with any updates that are in origin/master, run:

git merge origin/master 

If origin/master is set as the upstream of master, and you are on master, you can run:

git merge 

with no arguments at all.

(As noted in commits above, be sure your Git is at least version 1.8.2.)

1 Comment

@TimBiegeleisen: it hadn't been while I was typing and clicked the post button :-) I was just a little slower than the other answer.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.