Re: [PATCH 4/5] Be more specific if upstream branch is not fetched
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 12, 2012, 15:15 UTC
- Message-ID
- <7vd37dgevr.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <4F869D37.1050508@in.waw.pl>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:
> maybe I'm missing something, but I think that git will not fetch branches > (or commits) which are not part of remote's refspecs.
A remote's refspec does not have to "store" a tracking branch. The branch is still fetched, but not stored anywhere locally.
> % cd clone > % git config remote.origin.fetch refs/heads/master:refs/remotes/master
In other words, the fetch refspec could be without colon. With
[remote "origin"]
url = ...
fetch = refs/heads/master
[branch "master"]
remote = origin
merge = refs/heads/masteryou can still say "git pull" without any other argument while on your "master" and it will do the right thing. Actually, you do not even have to have remote.origin.fetch at all (branch.master.merge will be added to the set of refs to be fetched).
In such a case "master@{upstream}" does not (and should not) resolve to anything, and the reason is not because it is not "fetched", but as Peff said, because it is not "stored".