Re: What is the default refspec for fetch?
- From
Jeff King <peff@peff.net>
- Date
- Nov 8, 2014, 10:52 UTC
- Message-ID
- <20141108105221.GA20750@peff.net>
- In-Reply-To
- <CAENte7inZ5fm2SzNPq=HNPKnPco9tM4T_es5Dphnpbia-uiLdg@mail.gmail.com>
On Fri, Nov 07, 2014 at 04:31:08PM +0100, Christian Halstrick wrote:
> In a repo where no remote.<name>.fetch config parameter is set what > should a "git fetch" do? My experiments let me think it's > "HEAD:FETCH_HEAD". Right?
Basically, yes. We always write FETCH_HEAD, regardless of the refspec. We choose "HEAD" if no other refspec was provided. So it is really more like
git fetch $remote HEAD
This is what makes one-off bare-url pulls work, like:
git pull git://...
It runs fetch under the hood, which writes into FETCH_HEAD, and then we merge that.
-Peff