On Mon, Jan 13, 2020 at 9:31 AM peter green <plugwash@xxxxxxxxxxx> wrote: > > 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).