Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move a git note to a different commit?

Tags:

git

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.

like image 957
ThorSummoner Avatar asked Oct 24 '25 20:10

ThorSummoner


1 Answers

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.

like image 89
ThorSummoner Avatar answered Oct 27 '25 17:10

ThorSummoner