0

A typical use of notes is to supplement a commit message without changing the commit itself. Notes can be shown by git log along with the original commit message (Git-notes documentation). With TortoiseGit I can create a note by Edit notes context menu, and then push this note to a remote repository by the Sync -> Push notes command. The notes then appear in the remote repository as expected.

On the other side I didn't find any possibility to fetch notes, neither with clone, nor with fetch or pull command.

What is the usual way to make sure git notes appear in every cloned repository?

Edit: I'm using TortoiseGit 2.7.0.0 and Git 2.19.2.windows.1 on Windows 10.

Christoph Jüngling
  • 1,080
  • 7
  • 26

1 Answers1

0

Notes are implemented in Git as a "normal" branch.

Therefore, you can easily fetch, pull and push it using refs/notes/commits. Just enter refs/notes/commits as local and remote branch in the fetch/pull/push dialog.

cf. https://web.archive.org/web/20180121193320/http://git-scm.com/blog/2010/08/25/notes.html and https://stackoverflow.com/a/18269026/3906760.

MrTux
  • 32,350
  • 30
  • 109
  • 146
  • Thank you, @mrtux. I found that before, but my question was about TortoiseGit (I tweaked the title of my question). I assume it would be an easy solution for this tool. Because it can edit, show and push notes, I suppose it can pull them, too. – Christoph Jüngling Dec 08 '18 at 10:47
  • Indeed I could not find any possibility in TortoiseGit to do this, because at all places I just found dropdown lists without permission to enter free text. But there is the alternative to add the line `fetch = +refs/notes/*:refs/notes/*` to the remote's section of the `.git/config` file. From this time on, notes are fetched automatically. – Christoph Jüngling Dec 13 '18 at 13:59