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

Re: under what circumstances will git replacements be pushed/pulled

From
Elijah Newren <newren@gmail.com>
Date
Jan 13, 2020, 17:47 UTC
Message-ID
<CABPp-BH49aX=DX=p3bNZaTo8LKt=FH_J3h34Tbf2cYx+DJD2LQ@mail.gmail.com>
In-Reply-To
<7adb48ad-299d-bbec-c467-b29376583486@p10link.net>
On Mon, Jan 13, 2020 at 9:31 AM peter green <plugwash@p10link.net> wrote:
Show 12 quoted lines
>
> I need to make some local tweaks to history to make merges go more smoothly, traditionally the tool for doing this is grafts, however git is yelling at me that grafts are deprecated and will be removed in a future release and that I should use git-replace instead.
>
> However there is something that is concerning me, https://git.wiki.kernel.org/index.php/GraftPoint says
>
>  > As of Git 1.6.5, the more flexible git replace has been added, which
>  > allows you to replace any object with any other object, and tracks
>  > the associations via refs which can be pushed and pulled between repos.
>
> However the git-replace man page makes no mention of push or pull.
>
> under what circumstances will replacements be pushed or pulled, and what if any steps do I need to take to ensure that my replacements stay local.
People have to take special steps to push or pull replace refs.

Replace refs are special refnames in the refs/replace/ hierarchy. Since clones by default only grab stuff under refs/heads/ and refs/tags/ and set up fetches to do likewise, you don't get these by default. None of the push.default settings (simple, upstream, matching, current) will push these either. So, if the user wants to transfer replace refs, they either need to manually call out the refspecs, use a special fetch/push flag like --mirror, or set up a special remote.<name>.fetch or remote.<name>.push config setting.

In other words, your replace references are local-only by default. Anyone who wants to share them will have to be the ones to take special steps, and likely at more than one stage (e.g. a special step to push them to some central repo, and notify your co-worker of the special commands they have to use to fetch them).

Previous: peter green
Message 2 of 2 in “under what circumstances will git replacements be pushed/pulled”
  1. peter greenJan 13, 2020
  2. Elijah NewrenJan 13, 2020

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.