git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Dose git-fetch need --reference option like git-clone?

From
Mike Hommey <mh@glandium.org>
Date
Nov 11, 2007, 08:38 UTC
Message-ID
<20071111083840.GA17231@glandium.org>
In-Reply-To
<46dff0320711110009y713c7d38q7b1457c92daecef6@mail.gmail.com>
On Sun, Nov 11, 2007 at 04:09:55PM +0800, Yin Ping wrote:
Show 13 quoted lines
> I want to track remote repsotory (say remoteA) on my local repository
> (say localB), so i do the following in directory localB
> $ git remote add remoteA git://remoteAUrl
> $ git fetch remoteA
> This will fetch all objects from git://remoteAUrl if localB and
> remoteA don't have common objects.
> 
> If I already have a cloned remoteA on local machine (say
> /path/to/remoteACloned), I want to do following to reduce the net
> traffic as git-clone:
> git fetch --reference /path/to/remoteACloned remotedA
> 
> Is this reasonable? Or is there already a resolution for this case?

It would probably be reasonable to have this on git-remote. Anyways, you can easily do it yourself by editing .git/objects/info/alternates and adding /path/to/remoteACloned in it. You can happily git fetch after that.

Mike
Previous: Yin PingNext: Junio C Hamano
Message 4 of 5 in “Dose git-fetch need --reference option like git-clone?”
  1. Yin PingNov 11, 2007
  2. Junio C HamanoNov 11, 2007
  3. Yin PingNov 11, 2007
  4. Mike HommeyNov 11, 2007
  5. Junio C HamanoNov 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.