I've searched high and low to understand this, and I feel it is just slipping through my fingers. There are similar, but not identical, QnAs here.
The problem:
$ git pull
Your configuration specifies to merge with the ref 'master'
from the remote, but no such ref was fetched.
Whereas git fetch
gives nothing, followed by git merge origin
which says Already up-to-date.
, which is what I expected had git pull
worked 'properly'.
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "official"]
url = git://github.com/freenet/wininstaller-official.git
fetch = +refs/heads/*:refs/remotes/official/*
[remote "origin"]
url = git://github.com/freenet/wininstaller-staging.git
fetch = +refs/heads/*:refs/remotes/origin/*
tagopt = --tags
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "t"]
remote = origin
merge = refs/heads/master
$ cat .git/refs/remotes/origin/master
1a30b106723624321366f40a078c9ca4c28394ec
$ cat .git/refs/heads/master
1a30b106723624321366f40a078c9ca4c28394ec
Why does git pull give error, whilst git fetch/merge produce the expected output?
Background: I cloned a git repo, freenet/wininstaller-official.git, then saw wininstaller-staging.git and thought "there's likely some not insubstantial overlap there, I ought to add 'staging' as a remote to the first repo". Yeah, now we're cooking with git! This will be so efficient.
Then I thought "staging might be better to track, let's call that origin, and have my local master track new origin/master". Wow! Uber-elte am I!
So I rename remotes as above, delete local master, checkout new master tracking new origin/master.
And git fetch; git merge
seems to prove it works right!
But alas, git pull
errors out. Woe is me. Not so uber-elite after all :(
TIA