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

Re: Using git-replace in place of grafts -- and publishing .git/refs/replace between repos?

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 15, 2012, 17:21 UTC
Message-ID
<7vvcffyzfh.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACffvTp4qnHc3RHKDotEfvshVDqGtTX6eh6Fr-bmJSMUvTFN6g@mail.gmail.com>
David Chanters <david.chanters@googlemail.com> writes:
> 1.  I thought the replace data in .git/refs/replace was published when
> I did "git push" so that others could use this information as a
> base-point, yet it seems not to be the case.  How do I publish this?

If you don't tell it what to push, the command will just update the branches. You can tell "git push" what you want to push explicitly, e.g.

    $ git replace -l ;# to learn what replacement I want to send
    77d5ba8477eb90509e79dbcf63814a3dfdefb906
    $ git push origin refs/replace/77d5ba8477eb90509e79dbcf63814a3dfdefb906
> 2.  If I do publish it, are there any caveats with that?  i.e.,
> because the replace data will likely point to a repo which in my
> working checkout I added with "git-remote", is that going to be a
> problem?

That is between you and other project participants. They may not want to see replacement in their project in the first place.

Assuming that they do, pushing the replacement ref makes the replacing object available in the pushed-into repository, so they will *not* rely on your repository.

Previous: David ChantersNext: David Chanters
Message 2 of 5 in “Using git-replace in place of grafts -- and publishing .git/refs/replace between repos?”
  1. David ChantersSep 15, 2012
  2. Junio C HamanoSep 15, 2012
  3. David ChantersSep 15, 2012
  4. Christian CouderSep 16, 2012
  5. Junio C HamanoSep 16, 2012

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.