如何将git笔记移至其他提交? [英] How to move a git note to a different commit?

查看:107
本文介绍了如何将git笔记移至其他提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我错误地记录了错误的提交。是否有一种简单的方法将其整体移动到不同的提交中?



我希望能将语义重新注释到另一个提交中,但是无论是最简单的将是很好的知道。我怀疑最简单的方法是将文本复制粘贴到桌面剪贴板上。 解决方案

可能最简单的方法是复制删除注释:



例如,要将HEAD注释移动到前一个提交,

 #/!\被警告,这可能是一种破坏性行为

#git notes copy< source> < DEST>
git notes复制HEAD HEAD ^

#git notes remove< target>
git notes remove HEAD






注释在修改提交时不会自动迁移。


I've made a note on the wrong commit by mistake. Is there a easy way to move it in whole to a different commit?

I'm hoping for a way to semantically re-parent a note onto a different commit, But whatever is easiest would be great to know. I suspect the easiest option will be to copy paste the text with a desktop clipboard.

解决方案

possibly the easiest way is to copy and remove the note:

For example, to move the HEAD notes to the previous commit,

# /!\ Be warned, this may be a destructive act

# git notes copy <source> <dest>
git notes copy HEAD HEAD^

# git notes remove <target>
git notes remove HEAD


P.S. notes are not automatically migrated when amending a commit.

这篇关于如何将git笔记移至其他提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆