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.deleteNote({
  sha: "abc123def456...",
  author: { name: "Cleanup Bot", email: "cleanup@example.com" },
  expectedRefSha: currentNotesRefSha, // optional optimistic lock
});

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

Options

sha
string
required
Commit SHA to remove the note from
author
string
Author signature (name and email)
expectedRefSha
string
Expected notes ref SHA for optimistic concurrency control
ttl
string
Token TTL. Token TTL in seconds.

Response

sha
string
The commit SHA the note was attached to
targetRef
string
The notes reference (refs/notes/commits)
baseCommit
string
Previous notes ref commit SHA
newRefSha
string
New notes ref SHA after the operation
result
object
Operation result with success, status, and optional message