Skip to main content
Git notes allow you to attach metadata to commits without modifying the commit itself. Notes are stored in refs/notes/commits and are useful for storing build status, review comments, or other annotations.
const result = await repo.appendNote({
  sha: "abc123def456...",
  note: "\n---\nReviewed by @alice - LGTM",
  author: { name: "Review Bot", email: "review@example.com" },
});

console.log(`Note updated, new ref: ${result.newRefSha}`);

Options

ParameterTypeDescription
shaRequiredCommit SHA to attach the note to
noteRequiredNote content to append
authorOptionalAuthor signature (name and email)
expectedRefSha (TypeScript)
expected_ref_sha (Python)
OptionalExpected notes ref SHA for optimistic concurrency control
ttlOptionalToken TTL in seconds

Response

FieldTypeDescription
shaStringThe commit SHA the note is attached to
targetRef (TypeScript)
target_ref (Python)
StringThe notes reference (refs/notes/commits)
baseCommit (TypeScript)
base_commit (Python)
OptionalPrevious notes ref commit SHA
newRefSha (TypeScript)
new_ref_sha (Python)
StringNew notes ref SHA after the operation
resultObjectOperation result with success, status, and optional message
Throws RefUpdateError when the notes ref has been modified concurrently (if expectedRefSha was provided) or if the operation fails.