git:关于合并注释引用的查询



合并注释引用的推荐方法是

git checkout refs/notes/commits
git fetch origin refs/notes/commits:refs/notes/origin/commits
git notes merge -v origin/commits
git notes merge --commit

我尝试了这种方法,它无助于维护线性历史记录。以下是执行上述步骤后获得的日志。

*   857410f Merged notes from refs/notes/origin/commits into refs/notes/commits
|
| *   1d6ff9e Merged notes from refs/notes/origin/commits into refs/notes/commits
| |
| | * 18dec97 Notes added by 'git notes add'
| | * 2b7cfae Notes added by 'git notes add'
| | * 9e5e223 Notes added by 'git notes add'
| * 49ae944 Notes added by 'git notes add'
* 8f5fd8a Notes added by 'git notes add'

所以我的问题是,这是执行 git 笔记合并的正确方法吗?请尽快帮忙。谢谢。

似乎git notes merge只能进行真正的合并。

这是正确的方法吗?好吧,这似乎是最简单的方法,以及笔记的提交日志看起来有多整洁 [1]可以说,比常规提交日志重要得多。

但是,如果您想改用变基:

git switch --detach notes/commits
git rebase notes/origin/commits
git update-ref refs/notes/commits @
git switch -q -

完整演示

笔记

  1. 显然,合并是否"整洁"是主观的

最新更新