How to move a git note to a different commit?


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.

Show source
| git   2017-01-03 22:01 1 Answers

Answers ( 1 )

  1. 2017-01-03 22:01

    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.

◀ Go back