如何推送'refs/replace'而不在git中推送任何其他引用?

aby*_*s.7 16 git

我用这种方式用另一个提交替换了一个提交:

* HEAD
|
...
|
* ==> *  `git replace left_commit right_commit`
|     |
*-----/
|
...
Run Code Online (Sandbox Code Playgroud)

这个替换放在.git/refs/replace文件夹中,所以我想知道 - 如何将这个refs推送到远程端?

aby*_*s.7 18

邮件列表中找到答案:

git push origin 'refs/replace/*'
git fetch origin 'refs/replace/*:refs/replace/*'
Run Code Online (Sandbox Code Playgroud)

现在只有显式的推送和提取才能在git中正常工作.