-2

This may sound like a silly question :P. Supposedly, i add a note to a particular commit, say commitno

git notes add -m "Sample Note" $commitno
git push origin refs/master/*

which internally generates a commit for a note(say, commitID). how to get the note using that commitID of the note?

Iowa
  • 2,171
  • 4
  • 22
  • 31
  • I suggest you to read this post: http://stackoverflow.com/questions/18273879/git-get-the-commit-id-and-the-note-of-a-commit. It has a huge explanation about notes in git. And it is just two days old – ThanksForAllTheFish Aug 19 '13 at 09:29
  • I don't know what you mean by "internally generates a commit for a note(say, commitID)", but if you mean the remote to which you push, adds a note to *its* `refs/notes/commits` pseudo-branch, you'll have to `fetch` the resulting ref to find the commit the remote added. – torek Aug 19 '13 at 17:26

1 Answers1

0
$ git branch -v
* master 6ff9387 Initial commit

$ git notes add -m "sample note" 6ff9387

$ git notes
7a902ca6d69fbd2c440ac0a714380cfd8a387262 6ff9387eeab6449cdc2948e47882725722b1145f

$ git cat-file -p 7a902ca6d69fbd2c440ac0a714380cfd8a387262
sample note
nyzm
  • 2,787
  • 3
  • 24
  • 30
  • But here you are cat'ting the content of the file whose name is the commit ID of the commit made in another branch. I want to get the note using its own commit ID. – Iowa Aug 19 '13 at 09:36