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

Re: How to git push mirror local refs only?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 19, 2017, 17:58 UTC
Message-ID
<xmqq4lvbuaef.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAHd499Aft6yE=8f8DGRVxMYNR5kg6AVs3tECVtz1VDdwFeL5fg@mail.gmail.com>
Robert Dailey <rcdailey.lists@gmail.com> writes:
Show 21 quoted lines
> On Fri, Jun 9, 2017 at 8:53 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Robert Dailey <rcdailey.lists@gmail.com> writes:
>>
>>> So I want to update my remote fork with all my local branches.
>>> Normally I'd do this:
>>>
>>> $ git push --mirror fork
>>> ...
>> Something along this line in your .git/config:
>>
>>         [remote "fork"]
>>                 url = ...
>>                 push = refs/heads/*:refs/heads/*
>>
>> and then
>>
>>         $ git push --prune --follow-tags fork
>
> Sorry for the late reply, I was out of town all last week. Thanks for
> your help. Does this serve as a good general default? I can't imagine
> a case where I'd ever want to push something inside refs/remotes.

It may, as a good general default to something other than --mirror, perhaps. When I ask for mirroring the state of my repository, I'd expect it to preserve as much state as possible, including the tips of histories I received from elsewhere.

Previous: Robert Dailey
Message 4 of 4 in “How to git push mirror local refs only?”
  1. Robert DaileyJun 9, 2017
  2. Junio C HamanoJun 10, 2017
  3. Robert DaileyJun 19, 2017
  4. Junio C HamanoJun 19, 2017

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.