CINXE.COM
Git - git-notes Documentation
<!DOCTYPE html> <html lang="en"> <head> <script type="text/javascript"> const currentTheme = localStorage.getItem("theme") if (currentTheme) { const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)").matches if ((prefersDarkScheme && currentTheme === "light") || (!prefersDarkScheme && currentTheme === "dark")) { document.documentElement.dataset.theme = currentTheme } } </script> <meta charset='utf-8'> <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Git - git-notes Documentation</title> <link href="/favicon.ico" rel='shortcut icon' type='image/x-icon'> <link rel="stylesheet" href="/application.min.css"> </head> <body id="documentation"> <div class="inner"> <header> <a id="logo" href="/"><img src="/images/logo@2x.png" width="110" height="46" alt="Git" class="no-filter" /></a> <span id="tagline"></span> <script type="text/javascript"> const taglines = [ "fast-version-control", "everything-is-local", "distributed-even-if-your-workflow-isnt", "local-branching-on-the-cheap", "distributed-is-the-new-centralized" ]; var tagline = taglines[Math.floor(Math.random() * taglines.length)]; document.getElementById('tagline').innerHTML = '--' + tagline; </script> <div id="search-container"> <form id="search" action="/search/results"> <input id="search-text" name="search" placeholder="Type / to search entire site…" autocomplete="off" type="text" /> </form> <div id="search-results"></div> </div> <img src="/images/dark-mode.svg" id="dark-mode-button" /> </header> </div> <div class="inner"> <div id="content-wrapper"> <div tabindex="1" class="sidebar-btn"></div> <aside class="sidebar" id="sidebar"> <nav> <ul> <li> <a href="/about">About</a> <ul> </ul> </li> <li> <a href="/doc" class="active">Documentation</a> <ul class="expanded"> <li> <a href="/docs" class="active">Reference</a> </li> <li> <a href="/book">Book</a> </li> <li> <a href="/videos">Videos</a> </li> <li> <a href="/doc/ext">External Links</a> </li> </ul> </li> <li> <a href="/downloads">Downloads</a> <ul > <li> <a href="/downloads/guis">GUI Clients</a> </li> <li> <a href="/downloads/logos">Logos</a> </li> </ul> </li> <li> <a href="/community">Community</a> </li> </ul> </nav> </aside> <div id="content"> <div id='reference-version'> <a class="dropdown-trigger" id="reference-languages-trigger" data-panel-id="l10n-versions-dropdown" href="#"> English ▾</a> <div class='dropdown-panel right' id='l10n-versions-dropdown'> <header>Localized versions of <strong>git-notes</strong> manual</header> <ol class='reference-previous-versions'> <li> <a href="/docs/git-notes"><span class="version">English</span> </a> </li> <li> <a href="/docs/git-notes/fr"><span class="version">Français</span> </a> </li> <li> <a href="/docs/git-notes/pt_BR"><span class="version">Português (Brasil)</span> </a> </li> <li> <a href="/docs/git-notes/zh_HANS-CN"><span class="version">简体中文</span> </a> </li> </ol> <footer> Want to read in your language or fix typos?<br/> <a href="https://github.com/jnavila/git-manpages-l10n">You can help translate this page</a>. </footer> </div> <a class="dropdown-trigger" id="reference-topics-trigger" data-panel-id="topics-dropdown" href="#">Topics ▾</a> <div class='dropdown-panel right' id='topics-dropdown'> <div class='three-column'> <div class='column-left'> <h3 class='setup'>Setup and Config</h3> <ul class='unstyled'> <li> <a href="/docs/git"> git </a> </li> <li> <a href="/docs/git-config"> config </a> </li> <li> <a href="/docs/git-help"> help </a> </li> <li> <a href="/docs/git-bugreport"> bugreport </a> </li> <li> <a href="/doc/credential-helpers"> Credential helpers </a> </li> </ul> <h3 class='projects'>Getting and Creating Projects</h3> <ul class='unstyled'> <li> <a href="/docs/git-init"> init </a> </li> <li> <a href="/docs/git-clone"> clone </a> </li> </ul> <h3 class='snapshotting'>Basic Snapshotting</h3> <ul class='unstyled'> <li> <a href="/docs/git-add"> add </a> </li> <li> <a href="/docs/git-status"> status </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-commit"> commit </a> </li> <li> <a href="/docs/git-notes"> notes </a> </li> <li> <a href="/docs/git-restore"> restore </a> </li> <li> <a href="/docs/git-reset"> reset </a> </li> <li> <a href="/docs/git-rm"> rm </a> </li> <li> <a href="/docs/git-mv"> mv </a> </li> </ul> <h3 class='branching'>Branching and Merging</h3> <ul class='unstyled'> <li> <a href="/docs/git-branch"> branch </a> </li> <li> <a href="/docs/git-checkout"> checkout </a> </li> <li> <a href="/docs/git-switch"> switch </a> </li> <li> <a href="/docs/git-merge"> merge </a> </li> <li> <a href="/docs/git-mergetool"> mergetool </a> </li> <li> <a href="/docs/git-log"> log </a> </li> <li> <a href="/docs/git-stash"> stash </a> </li> <li> <a href="/docs/git-tag"> tag </a> </li> <li> <a href="/docs/git-worktree"> worktree </a> </li> </ul> <h3 class='sharing'>Sharing and Updating Projects</h3> <ul class='unstyled'> <li> <a href="/docs/git-fetch"> fetch </a> </li> <li> <a href="/docs/git-pull"> pull </a> </li> <li> <a href="/docs/git-push"> push </a> </li> <li> <a href="/docs/git-remote"> remote </a> </li> <li> <a href="/docs/git-submodule"> submodule </a> </li> </ul> </div> <div class='column-middle'> <h3 class='inspection'>Inspection and Comparison</h3> <ul class='unstyled'> <li> <a href="/docs/git-show"> show </a> </li> <li> <a href="/docs/git-log"> log </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-difftool"> difftool </a> </li> <li> <a href="/docs/git-range-diff"> range-diff </a> </li> <li> <a href="/docs/git-shortlog"> shortlog </a> </li> <li> <a href="/docs/git-describe"> describe </a> </li> </ul> <h3 class='patching'>Patching</h3> <ul class='unstyled'> <li> <a href="/docs/git-apply"> apply </a> </li> <li> <a href="/docs/git-cherry-pick"> cherry-pick </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-rebase"> rebase </a> </li> <li> <a href="/docs/git-revert"> revert </a> </li> </ul> <h3 class='debugging'>Debugging</h3> <ul class='unstyled'> <li> <a href="/docs/git-bisect"> bisect </a> </li> <li> <a href="/docs/git-blame"> blame </a> </li> <li> <a href="/docs/git-grep"> grep </a> </li> </ul> <h3 class='email'>Email</h3> <ul class='unstyled'> <li> <a href="/docs/git-am"> am </a> </li> <li> <a href="/docs/git-apply"> apply </a> </li> <li> <a href="/docs/git-format-patch"> format-patch </a> </li> <li> <a href="/docs/git-send-email"> send-email </a> </li> <li> <a href="/docs/git-request-pull"> request-pull </a> </li> </ul> <h3 class='external'>External Systems</h3> <ul class='unstyled'> <li> <a href="/docs/git-svn"> svn </a> </li> <li> <a href="/docs/git-fast-import"> fast-import </a> </li> </ul> <h3 class='server-admin'>Server Admin</h3> <ul class='unstyled'> <li> <a href="/docs/git-daemon"> daemon </a> </li> <li> <a href="/docs/git-update-server-info"> update-server-info </a> </li> </ul> </div> <div class='column-right'> <h3 class='guides'>Guides</h3> <ul class='unstyled'> <li> <a href="/docs/gitattributes"> gitattributes </a> </li> <li> <a href="/docs/gitcli"> Command-line interface conventions </a> </li> <li> <a href="/docs/giteveryday"> Everyday Git </a> </li> <li> <a href="/docs/gitfaq"> Frequently Asked Questions (FAQ) </a> </li> <li> <a href="/docs/gitglossary"> Glossary </a> </li> <li> <a href="/docs/githooks"> Hooks </a> </li> <li> <a href="/docs/gitignore"> gitignore </a> </li> <li> <a href="/docs/gitmodules"> gitmodules </a> </li> <li> <a href="/docs/gitrevisions"> Revisions </a> </li> <li> <a href="/docs/gitsubmodules"> Submodules </a> </li> <li> <a href="/docs/gittutorial"> Tutorial </a> </li> <li> <a href="/docs/gitworkflows"> Workflows </a> </li> <li> <a href="/docs/git#_guides"> All guides... </a> </li> </ul> <h3 class='admin'>Administration</h3> <ul class='unstyled'> <li> <a href="/docs/git-clean"> clean </a> </li> <li> <a href="/docs/git-gc"> gc </a> </li> <li> <a href="/docs/git-fsck"> fsck </a> </li> <li> <a href="/docs/git-reflog"> reflog </a> </li> <li> <a href="/docs/git-filter-branch"> filter-branch </a> </li> <li> <a href="/docs/git-instaweb"> instaweb </a> </li> <li> <a href="/docs/git-archive"> archive </a> </li> <li> <a href="/docs/git-bundle"> bundle </a> </li> </ul> <h3 class='plumbing'>Plumbing Commands</h3> <ul class='unstyled'> <li> <a href="/docs/git-cat-file"> cat-file </a> </li> <li> <a href="/docs/git-check-ignore"> check-ignore </a> </li> <li> <a href="/docs/git-checkout-index"> checkout-index </a> </li> <li> <a href="/docs/git-commit-tree"> commit-tree </a> </li> <li> <a href="/docs/git-count-objects"> count-objects </a> </li> <li> <a href="/docs/git-diff-index"> diff-index </a> </li> <li> <a href="/docs/git-for-each-ref"> for-each-ref </a> </li> <li> <a href="/docs/git-hash-object"> hash-object </a> </li> <li> <a href="/docs/git-ls-files"> ls-files </a> </li> <li> <a href="/docs/git-ls-tree"> ls-tree </a> </li> <li> <a href="/docs/git-merge-base"> merge-base </a> </li> <li> <a href="/docs/git-read-tree"> read-tree </a> </li> <li> <a href="/docs/git-rev-list"> rev-list </a> </li> <li> <a href="/docs/git-rev-parse"> rev-parse </a> </li> <li> <a href="/docs/git-show-ref"> show-ref </a> </li> <li> <a href="/docs/git-symbolic-ref"> symbolic-ref </a> </li> <li> <a href="/docs/git-update-index"> update-index </a> </li> <li> <a href="/docs/git-update-ref"> update-ref </a> </li> <li> <a href="/docs/git-verify-pack"> verify-pack </a> </li> <li> <a href="/docs/git-write-tree"> write-tree </a> </li> </ul> </div> </div> </div> <a class="dropdown-trigger" id="reference-versions-trigger" data-panel-id="previous-versions-dropdown" href="#"> Latest version ▾ </a> <span class="light d-flex">git-notes last updated in 2.49.0</span> <div class='dropdown-panel left' id='previous-versions-dropdown'> <header>Changes in the <strong>git-notes</strong> manual</header> <ol class='reference-previous-versions'> <li> <a href="/docs/git-notes/2.49.0"><span class="version">2.49.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2025-03-14</em> </a> </li> <li class="no-change"><span>2.48.1 no changes</span></li> <li> <a href="/docs/git-notes/2.48.0"><span class="version">2.48.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2025-01-10</em> </a> </li> <li class="no-change"><span>2.44.1 → 2.47.2 no changes</span></li> <li> <a href="/docs/git-notes/2.44.0"><span class="version">2.44.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2024-02-23</em> </a> </li> <li class="no-change"><span>2.43.1 → 2.43.6 no changes</span></li> <li> <a href="/docs/git-notes/2.43.0"><span class="version">2.43.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2023-11-20</em> </a> </li> <li class="no-change"><span>2.42.1 → 2.42.4 no changes</span></li> <li> <a href="/docs/git-notes/2.42.0"><span class="version">2.42.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2023-08-21</em> </a> </li> <li class="no-change"><span>2.38.1 → 2.41.3 no changes</span></li> <li> <a href="/docs/git-notes/2.38.0"><span class="version">2.38.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2022-10-02</em> </a> </li> <li class="no-change"><span>2.29.1 → 2.37.7 no changes</span></li> <li> <a href="/docs/git-notes/2.29.0"><span class="version">2.29.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2020-10-19</em> </a> </li> <li class="no-change"><span>2.25.1 → 2.28.1 no changes</span></li> <li> <a href="/docs/git-notes/2.25.0"><span class="version">2.25.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2020-01-13</em> </a> </li> <li class="no-change"><span>2.22.1 → 2.24.4 no changes</span></li> <li> <a href="/docs/git-notes/2.22.0"><span class="version">2.22.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-06-07</em> </a> </li> <li class="no-change"><span>2.19.1 → 2.21.4 no changes</span></li> <li> <a href="/docs/git-notes/2.19.0"><span class="version">2.19.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-09-10</em> </a> </li> <li class="no-change"><span>2.17.0 → 2.18.5 no changes</span></li> <li> <a href="/docs/git-notes/2.16.6"><span class="version">2.16.6</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li class="no-change"><span>2.15.4 no changes</span></li> <li> <a href="/docs/git-notes/2.14.6"><span class="version">2.14.6</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li class="no-change"><span>2.10.5 → 2.13.7 no changes</span></li> <li> <a href="/docs/git-notes/2.9.5"><span class="version">2.9.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-07-30</em> </a> </li> <li> <a href="/docs/git-notes/2.8.6"><span class="version">2.8.6</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-07-30</em> </a> </li> <li class="no-change"><span>2.7.6 no changes</span></li> <li> <a href="/docs/git-notes/2.6.7"><span class="version">2.6.7</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-05-05</em> </a> </li> <li class="no-change"><span>2.4.12 → 2.5.6 no changes</span></li> <li> <a href="/docs/git-notes/2.3.10"><span class="version">2.3.10</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2015-09-28</em> </a> </li> <li class="no-change"><span>2.1.4 → 2.2.3 no changes</span></li> <li> <a href="/docs/git-notes/2.0.5"><span class="version">2.0.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2014-12-17</em> </a> </li> <li> </li> </ol> <footer> <p>Check your version of git by running</p> <code class="command">git --version</code> </footer> </div> </div> <div id="main" data-pagefind-filter="category:reference" data-pagefind-meta="category:Reference" data-pagefind-weight="0.05" data-pagefind-body> <div class="sect1"> <h2 id="_name"><a class="anchor" href="#_name"></a>NAME</h2> <div class="sectionbody"> <div class="paragraph"> <p>git-notes - Add or inspect object notes</p> </div> </div> </div> <div class="sect1"> <h2 id="_synopsis"><a class="anchor" href="#_synopsis"></a>SYNOPSIS</h2> <div class="sectionbody"> <div class="paragraph"> <p>git notes [list [<object>]] git notes add [-f] [--allow-empty] [--[no-]separator | --separator=<paragraph-break>] [--[no-]stripspace] [-F <file> | -m <msg> | (-c | -C) <object>] [-e] [<object>] git notes copy [-f] ( --stdin | <from-object> [<to-object>] ) git notes append [--allow-empty] [--[no-]separator | --separator=<paragraph-break>] [--[no-]stripspace] [-F <file> | -m <msg> | (-c | -C) <object>] [-e] [<object>] git notes edit [--allow-empty] [<object>] [--[no-]stripspace] git notes show [<object>] git notes merge [-v | -q] [-s <strategy> ] <notes-ref> git notes merge --commit [-v | -q] git notes merge --abort [-v | -q] git notes remove [--ignore-missing] [--stdin] [<object>…​] git notes prune [-n] [-v] git notes get-ref</p> </div> </div> </div> <div class="sect1"> <h2 id="_description"><a class="anchor" href="#_description"></a>DESCRIPTION</h2> <div class="sectionbody"> <div class="paragraph"> <p>Adds, removes, or reads notes attached to objects, without touching the objects themselves.</p> </div> <div class="paragraph"> <p>By default, notes are saved to and read from <code>refs/notes/commits</code>, but this default can be overridden. See the OPTIONS, CONFIGURATION, and ENVIRONMENT sections below. If this ref does not exist, it will be quietly created when it is first needed to store a note.</p> </div> <div class="paragraph"> <p>A typical use of notes is to supplement a commit message without changing the commit itself. Notes can be shown by <code>git log</code> along with the original commit message. To distinguish these notes from the message stored in the commit object, the notes are indented like the message, after an unindented line saying "Notes (<em><refname></em>):" (or "Notes:" for <code>refs/notes/commits</code>).</p> </div> <div class="paragraph"> <p>Notes can also be added to patches prepared with <code>git format-patch</code> by using the <code>--notes</code> option. Such notes are added as a patch commentary after a three dash separator line.</p> </div> <div class="paragraph"> <p>To change which notes are shown by <code>git log</code>, see the <code>notes.displayRef</code> discussion in <a href="#CONFIGURATION">CONFIGURATION</a>.</p> </div> <div class="paragraph"> <p>See the <code>notes.rewrite.<command></code> configuration for a way to carry notes across commands that rewrite commits.</p> </div> </div> </div> <div class="sect1"> <h2 id="_subcommands"><a class="anchor" href="#_subcommands"></a>SUBCOMMANDS</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-notes.txt-codelistcode"> <a class="anchor" href="#Documentation/git-notes.txt-codelistcode"></a><code>list</code> </dt> <dd> <p>List the notes object for a given object. If no object is given, show a list of all note objects and the objects they annotate (in the format "<code><note-object> <annotated-object></code>"). This is the default subcommand if no subcommand is given.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codeaddcode"> <a class="anchor" href="#Documentation/git-notes.txt-codeaddcode"></a><code>add</code> </dt> <dd> <p>Add notes for a given object (defaults to <code>HEAD</code>). Abort if the object already has notes (use <code>-f</code> to overwrite existing notes). However, if you’re using <code>add</code> interactively (using an editor to supply the notes contents), then - instead of aborting - the existing notes will be opened in the editor (like the <code>edit</code> subcommand). If you specify multiple <code>-m</code> and <code>-F</code>, a blank line will be inserted between the messages. Use the <code>--separator</code> option to insert other delimiters. You can use <code>-e</code> to edit and fine-tune the message(s) supplied from <code>-m</code> and <code>-F</code> options interactively (using an editor) before adding the note.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codecopycode"> <a class="anchor" href="#Documentation/git-notes.txt-codecopycode"></a><code>copy</code> </dt> <dd> <p>Copy the notes for the first object onto the second object (defaults to <code>HEAD</code>). Abort if the second object already has notes, or if the first object has none (use <code>-f</code> to overwrite existing notes to the second object). This subcommand is equivalent to: <code>git notes add [-f] -C $(git notes list <from-object>) <to-object></code></p> <div class="paragraph"> <p>In <code>--stdin</code> mode, take lines in the format</p> </div> <div class="listingblock"> <div class="content"> <pre><from-object> SP <to-object> [ SP <rest> ] LF</pre> </div> </div> <div class="paragraph"> <p>on standard input, and copy the notes from each <em><from-object></em> to its corresponding <em><to-object></em>. (The optional <em><rest></em> is ignored so that the command can read the input given to the <code>post-rewrite</code> hook.)</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codeappendcode"> <a class="anchor" href="#Documentation/git-notes.txt-codeappendcode"></a><code>append</code> </dt> <dd> <p>Append new message(s) given by <code>-m</code> or <code>-F</code> options to an existing note, or add them as a new note if one does not exist, for the object (defaults to <code>HEAD</code>). When appending to an existing note, a blank line is added before each new message as an inter-paragraph separator. The separator can be customized with the <code>--separator</code> option. Edit the notes to be appended given by <code>-m</code> and <code>-F</code> options with <code>-e</code> interactively (using an editor) before appending the note.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codeeditcode"> <a class="anchor" href="#Documentation/git-notes.txt-codeeditcode"></a><code>edit</code> </dt> <dd> <p>Edit the notes for a given object (defaults to <code>HEAD</code>).</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codeshowcode"> <a class="anchor" href="#Documentation/git-notes.txt-codeshowcode"></a><code>show</code> </dt> <dd> <p>Show the notes for a given object (defaults to <code>HEAD</code>).</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codemergecode"> <a class="anchor" href="#Documentation/git-notes.txt-codemergecode"></a><code>merge</code> </dt> <dd> <p>Merge the given notes ref into the current notes ref. This will try to merge the changes made by the given notes ref (called "remote") since the merge-base (if any) into the current notes ref (called "local").</p> <div class="paragraph"> <p>If conflicts arise and a strategy for automatically resolving conflicting notes (see the "NOTES MERGE STRATEGIES" section) is not given, the <code>manual</code> resolver is used. This resolver checks out the conflicting notes in a special worktree (<code>.git/NOTES_MERGE_WORKTREE</code>), and instructs the user to manually resolve the conflicts there. When done, the user can either finalize the merge with <code>git notes merge --commit</code>, or abort the merge with <code>git notes merge --abort</code>.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-coderemovecode"> <a class="anchor" href="#Documentation/git-notes.txt-coderemovecode"></a><code>remove</code> </dt> <dd> <p>Remove the notes for given objects (defaults to <code>HEAD</code>). When giving zero or one object from the command line, this is equivalent to specifying an empty note message to the <code>edit</code> subcommand.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codeprunecode"> <a class="anchor" href="#Documentation/git-notes.txt-codeprunecode"></a><code>prune</code> </dt> <dd> <p>Remove all notes for non-existing/unreachable objects.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codeget-refcode"> <a class="anchor" href="#Documentation/git-notes.txt-codeget-refcode"></a><code>get-ref</code> </dt> <dd> <p>Print the current notes ref. This provides an easy way to retrieve the current notes ref (e.g. from scripts).</p> </dd> </dl> </div> </div> </div> <div class="sect1"> <h2 id="_options"><a class="anchor" href="#_options"></a>OPTIONS</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-notes.txt-code-fcode"> <a class="anchor" href="#Documentation/git-notes.txt-code-fcode"></a><code>-f</code> </dt> <dt class="hdlist1" id="Documentation/git-notes.txt-code--forcecode"> <a class="anchor" href="#Documentation/git-notes.txt-code--forcecode"></a><code>--force</code> </dt> <dd> <p>When adding notes to an object that already has notes, overwrite the existing notes (instead of aborting).</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code-mltmsggtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code-mltmsggtcode"></a><code>-m <msg></code> </dt> <dt class="hdlist1" id="Documentation/git-notes.txt-code--messageltmsggtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--messageltmsggtcode"></a><code>--message=<msg></code> </dt> <dd> <p>Use the given note message (instead of prompting). If multiple <code>-m</code> options are given, their values are concatenated as separate paragraphs. Lines starting with <code>#</code> and empty lines other than a single line between paragraphs will be stripped out. If you wish to keep them verbatim, use <code>--no-stripspace</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code-Fltfilegtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code-Fltfilegtcode"></a><code>-F <file></code> </dt> <dt class="hdlist1" id="Documentation/git-notes.txt-code--fileltfilegtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--fileltfilegtcode"></a><code>--file=<file></code> </dt> <dd> <p>Take the note message from the given file. Use <code>-</code> to read the note message from the standard input. Lines starting with <code>#</code> and empty lines other than a single line between paragraphs will be stripped out. If you wish to keep them verbatim, use <code>--no-stripspace</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code-Cltobjectgtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code-Cltobjectgtcode"></a><code>-C <object></code> </dt> <dt class="hdlist1" id="Documentation/git-notes.txt-code--reuse-messageltobjectgtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--reuse-messageltobjectgtcode"></a><code>--reuse-message=<object></code> </dt> <dd> <p>Take the given blob object (for example, another note) as the note message. (Use <code>git notes copy <object></code> instead to copy notes between objects.). By default, message will be copied verbatim, but if you wish to strip out the lines starting with <code>#</code> and empty lines other than a single line between paragraphs, use with <code>--stripspace</code> option.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code-cltobjectgtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code-cltobjectgtcode"></a><code>-c <object></code> </dt> <dt class="hdlist1" id="Documentation/git-notes.txt-code--reedit-messageltobjectgtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--reedit-messageltobjectgtcode"></a><code>--reedit-message=<object></code> </dt> <dd> <p>Like <code>-C</code>, but with <code>-c</code> the editor is invoked, so that the user can further edit the note message.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code--allow-emptycode"> <a class="anchor" href="#Documentation/git-notes.txt-code--allow-emptycode"></a><code>--allow-empty</code> </dt> <dd> <p>Allow an empty note object to be stored. The default behavior is to automatically remove empty notes.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code--no-separatorcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--no-separatorcode"></a><code>--[no-]separator</code> </dt> <dt class="hdlist1" id="Documentation/git-notes.txt-code--separatorltparagraph-breakgtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--separatorltparagraph-breakgtcode"></a><code>--separator=<paragraph-break></code> </dt> <dd> <p>Specify a string used as a custom inter-paragraph separator (a newline is added at the end as needed). If <code>--no-separator</code>, no separators will be added between paragraphs. Defaults to a blank line.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code--no-stripspacecode"> <a class="anchor" href="#Documentation/git-notes.txt-code--no-stripspacecode"></a><code>--[no-]stripspace</code> </dt> <dd> <p>Strip leading and trailing whitespace from the note message. Also strip out empty lines other than a single line between paragraphs. Lines starting with <code>#</code> will be stripped out in non-editor cases like <code>-m</code>, <code>-F</code> and <code>-C</code>, but not in editor case like <code>git notes edit</code>, <code>-c</code>, etc.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code--refltrefgtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--refltrefgtcode"></a><code>--ref <ref></code> </dt> <dd> <p>Manipulate the notes tree in <em><ref></em>. This overrides <code>GIT_NOTES_REF</code> and the <code>core.notesRef</code> configuration. The ref specifies the full refname when it begins with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise <code>refs/notes/</code> is prefixed to form a full name of the ref.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code--ignore-missingcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--ignore-missingcode"></a><code>--ignore-missing</code> </dt> <dd> <p>Do not consider it an error to request removing notes from an object that does not have notes attached to it.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code--stdincode"> <a class="anchor" href="#Documentation/git-notes.txt-code--stdincode"></a><code>--stdin</code> </dt> <dd> <p>Also read the object names to remove notes from the standard input (there is no reason you cannot combine this with object names from the command line).</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code-ncode"> <a class="anchor" href="#Documentation/git-notes.txt-code-ncode"></a><code>-n</code> </dt> <dt class="hdlist1" id="Documentation/git-notes.txt-code--dry-runcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--dry-runcode"></a><code>--dry-run</code> </dt> <dd> <p>Do not remove anything; just report the object names whose notes would be removed.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code-sltstrategygtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code-sltstrategygtcode"></a><code>-s <strategy></code> </dt> <dt class="hdlist1" id="Documentation/git-notes.txt-code--strategyltstrategygtcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--strategyltstrategygtcode"></a><code>--strategy=<strategy></code> </dt> <dd> <p>When merging notes, resolve notes conflicts using the given strategy. The following strategies are recognized: <code>manual</code> (default), <code>ours</code>, <code>theirs</code>, <code>union</code> and <code>cat_sort_uniq</code>. This option overrides the <code>notes.mergeStrategy</code> configuration setting. See the "NOTES MERGE STRATEGIES" section below for more information on each notes merge strategy.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code--commitcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--commitcode"></a><code>--commit</code> </dt> <dd> <p>Finalize an in-progress <code>git notes merge</code>. Use this option when you have resolved the conflicts that <code>git notes merge</code> stored in <code>.git/NOTES_MERGE_WORKTREE</code>. This amends the partial merge commit created by <code>git notes merge</code> (stored in <code>.git/NOTES_MERGE_PARTIAL</code>) by adding the notes in <code>.git/NOTES_MERGE_WORKTREE</code>. The notes ref stored in the <code>.git/NOTES_MERGE_REF</code> symref is updated to the resulting commit.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code--abortcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--abortcode"></a><code>--abort</code> </dt> <dd> <p>Abort/reset an in-progress <code>git notes merge</code>, i.e. a notes merge with conflicts. This simply removes all files related to the notes merge.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code-qcode"> <a class="anchor" href="#Documentation/git-notes.txt-code-qcode"></a><code>-q</code> </dt> <dt class="hdlist1" id="Documentation/git-notes.txt-code--quietcode"> <a class="anchor" href="#Documentation/git-notes.txt-code--quietcode"></a><code>--quiet</code> </dt> <dd> <p>When merging notes, operate quietly.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-code-vcode"> <a class="anchor" href="#Documentation/git-notes.txt-code-vcode"></a><code>-v</code> </dt> <dt class="hdlist1" id="Documentation/git-notes.txt-code--verbosecode"> <a class="anchor" href="#Documentation/git-notes.txt-code--verbosecode"></a><code>--verbose</code> </dt> <dd> <p>When merging notes, be more verbose. When pruning notes, report all object names whose notes are removed.</p> </dd> </dl> </div> </div> </div> <div class="sect1"> <h2 id="_discussion"><a class="anchor" href="#_discussion"></a>DISCUSSION</h2> <div class="sectionbody"> <div class="paragraph"> <p>Commit notes are blobs containing extra information about an object (usually information to supplement a commit’s message). These blobs are taken from notes refs. A notes ref is usually a branch which contains "files" whose paths are the object names for the objects they describe, with some directory separators included for performance reasons <sup class="footnote">[<a id="_footnoteref_1" class="footnote" href="#_footnotedef_1" title="View footnote.">1</a>]</sup>.</p> </div> <div class="paragraph"> <p>Every notes change creates a new commit at the specified notes ref. You can therefore inspect the history of the notes by invoking, e.g., <code>git log -p notes/commits</code>. Currently the commit message only records which operation triggered the update, and the commit authorship is determined according to the usual rules (see <a href='/docs/git-commit'>git-commit[1]</a>). These details may change in the future.</p> </div> <div class="paragraph"> <p>It is also permitted for a notes ref to point directly to a tree object, in which case the history of the notes can be read with <code>git log -p -g <refname></code>.</p> </div> </div> </div> <div class="sect1"> <h2 id="_notes_merge_strategies"><a class="anchor" href="#_notes_merge_strategies"></a>NOTES MERGE STRATEGIES</h2> <div class="sectionbody"> <div class="paragraph"> <p>The default notes merge strategy is <code>manual</code>, which checks out conflicting notes in a special work tree for resolving notes conflicts (<code>.git/NOTES_MERGE_WORKTREE</code>), and instructs the user to resolve the conflicts in that work tree. When done, the user can either finalize the merge with <code>git notes merge --commit</code>, or abort the merge with <code>git notes merge --abort</code>.</p> </div> <div class="paragraph"> <p>Users may select an automated merge strategy from among the following using either <code>-s</code>/<code>--strategy</code> option or configuring <code>notes.mergeStrategy</code> accordingly:</p> </div> <div class="paragraph"> <p><code>ours</code> automatically resolves conflicting notes in favor of the local version (i.e. the current notes ref).</p> </div> <div class="paragraph"> <p><code>theirs</code> automatically resolves notes conflicts in favor of the remote version (i.e. the given notes ref being merged into the current notes ref).</p> </div> <div class="paragraph"> <p><code>union</code> automatically resolves notes conflicts by concatenating the local and remote versions.</p> </div> <div class="paragraph"> <p><code>cat_sort_uniq</code> is similar to <code>union</code>, but in addition to concatenating the local and remote versions, this strategy also sorts the resulting lines, and removes duplicate lines from the result. This is equivalent to applying the "cat | sort | uniq" shell pipeline to the local and remote versions. This strategy is useful if the notes follow a line-based format where one wants to avoid duplicated lines in the merge result. Note that if either the local or remote version contain duplicate lines prior to the merge, these will also be removed by this notes merge strategy.</p> </div> </div> </div> <div class="sect1"> <h2 id="_examples"><a class="anchor" href="#_examples"></a>EXAMPLES</h2> <div class="sectionbody"> <div class="paragraph"> <p>You can use notes to add annotations with information that was not available at the time a commit was written.</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git notes add -m 'Tested-by: Johannes Sixt <j6t@kdbg.org>' 72a144e2 $ git show -s 72a144e [...] Signed-off-by: Junio C Hamano <gitster@pobox.com> Notes: Tested-by: Johannes Sixt <j6t@kdbg.org></pre> </div> </div> <div class="paragraph"> <p>In principle, a note is a regular Git blob, and any kind of (non-)format is accepted. You can binary-safely create notes from arbitrary files using <code>git hash-object</code>:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ cc *.c $ blob=$(git hash-object -w a.out) $ git notes --ref=built add --allow-empty -C "$blob" HEAD</pre> </div> </div> <div class="paragraph"> <p>(You cannot simply use <code>git notes --ref=built add -F a.out HEAD</code> because that is not binary-safe.) Of course, it doesn’t make much sense to display non-text-format notes with <code>git log</code>, so if you use such notes, you’ll probably need to write some special-purpose tools to do something useful with them.</p> </div> </div> </div> <div class="sect1"> <h2 id="CONFIGURATION"><a class="anchor" href="#CONFIGURATION"></a>CONFIGURATION</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-notes.txt-codecorenotesRefcode"> <a class="anchor" href="#Documentation/git-notes.txt-codecorenotesRefcode"></a><code>core.notesRef</code> </dt> <dd> <p>Notes ref to read and manipulate instead of <code>refs/notes/commits</code>. Must be an unabbreviated ref name. This setting can be overridden through the environment and command line.</p> </dd> </dl> </div> <div class="paragraph"> <p>Everything above this line in this section isn’t included from the <a href='/docs/git-config'>git-config[1]</a> documentation. The content that follows is the same as what’s found there:</p> </div> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-notes.txt-codenotesmergeStrategycode"> <a class="anchor" href="#Documentation/git-notes.txt-codenotesmergeStrategycode"></a><code>notes.mergeStrategy</code> </dt> <dd> <p>Which merge strategy to choose by default when resolving notes conflicts. Must be one of <code>manual</code>, <code>ours</code>, <code>theirs</code>, <code>union</code>, or <code>cat_sort_uniq</code>. Defaults to <code>manual</code>. See the "NOTES MERGE STRATEGIES" section of <a href='/docs/git-notes'>git-notes[1]</a> for more information on each strategy.</p> <div class="paragraph"> <p>This setting can be overridden by passing the <code>--strategy</code> option to <a href='/docs/git-notes'>git-notes[1]</a>.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codenotesltnamegtmergeStrategycode"> <a class="anchor" href="#Documentation/git-notes.txt-codenotesltnamegtmergeStrategycode"></a><code>notes.<name>.mergeStrategy</code> </dt> <dd> <p>Which merge strategy to choose when doing a notes merge into <code>refs/notes/<name></code>. This overrides the more general <code>notes.mergeStrategy</code>. See the "NOTES MERGE STRATEGIES" section in <a href='/docs/git-notes'>git-notes[1]</a> for more information on the available strategies.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codenotesdisplayRefcode"> <a class="anchor" href="#Documentation/git-notes.txt-codenotesdisplayRefcode"></a><code>notes.displayRef</code> </dt> <dd> <p>Which ref (or refs, if a glob or specified more than once), in addition to the default set by <code>core.notesRef</code> or <code>GIT_NOTES_REF</code>, to read notes from when showing commit messages with the <code>git log</code> family of commands.</p> <div class="paragraph"> <p>This setting can be overridden with the <code>GIT_NOTES_DISPLAY_REF</code> environment variable, which must be a colon separated list of refs or globs.</p> </div> <div class="paragraph"> <p>A warning will be issued for refs that do not exist, but a glob that does not match any refs is silently ignored.</p> </div> <div class="paragraph"> <p>This setting can be disabled by the <code>--no-notes</code> option to the <a href='/docs/git-log'>git-log[1]</a> family of commands, or by the <code>--notes=<ref></code> option accepted by those commands.</p> </div> <div class="paragraph"> <p>The effective value of <code>core.notesRef</code> (possibly overridden by <code>GIT_NOTES_REF</code>) is also implicitly added to the list of refs to be displayed.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codenotesrewriteltcommandgtcode"> <a class="anchor" href="#Documentation/git-notes.txt-codenotesrewriteltcommandgtcode"></a><code>notes.rewrite.<command></code> </dt> <dd> <p>When rewriting commits with <em><command></em> (currently <code>amend</code> or <code>rebase</code>), if this variable is <code>false</code>, git will not copy notes from the original to the rewritten commit. Defaults to <code>true</code>. See also <code>notes.rewriteRef</code> below.</p> <div class="paragraph"> <p>This setting can be overridden with the <code>GIT_NOTES_REWRITE_REF</code> environment variable, which must be a colon separated list of refs or globs.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codenotesrewriteModecode"> <a class="anchor" href="#Documentation/git-notes.txt-codenotesrewriteModecode"></a><code>notes.rewriteMode</code> </dt> <dd> <p>When copying notes during a rewrite (see the <code>notes.rewrite.<command></code> option), determines what to do if the target commit already has a note. Must be one of <code>overwrite</code>, <code>concatenate</code>, <code>cat_sort_uniq</code>, or <code>ignore</code>. Defaults to <code>concatenate</code>.</p> <div class="paragraph"> <p>This setting can be overridden with the <code>GIT_NOTES_REWRITE_MODE</code> environment variable.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codenotesrewriteRefcode"> <a class="anchor" href="#Documentation/git-notes.txt-codenotesrewriteRefcode"></a><code>notes.rewriteRef</code> </dt> <dd> <p>When copying notes during a rewrite, specifies the (fully qualified) ref whose notes should be copied. May be a glob, in which case notes in all matching refs will be copied. You may also specify this configuration several times.</p> <div class="paragraph"> <p>Does not have a default value; you must configure this variable to enable note rewriting. Set it to <code>refs/notes/commits</code> to enable rewriting for the default commit notes.</p> </div> <div class="paragraph"> <p>Can be overridden with the <code>GIT_NOTES_REWRITE_REF</code> environment variable. See <code>notes.rewrite.<command></code> above for a further description of its format.</p> </div> </dd> </dl> </div> </div> </div> <div class="sect1"> <h2 id="_environment"><a class="anchor" href="#_environment"></a>ENVIRONMENT</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-notes.txt-codeGITNOTESREFcode"> <a class="anchor" href="#Documentation/git-notes.txt-codeGITNOTESREFcode"></a><code>GIT_NOTES_REF</code> </dt> <dd> <p>Which ref to manipulate notes from, instead of <code>refs/notes/commits</code>. This overrides the <code>core.notesRef</code> setting.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codeGITNOTESDISPLAYREFcode"> <a class="anchor" href="#Documentation/git-notes.txt-codeGITNOTESDISPLAYREFcode"></a><code>GIT_NOTES_DISPLAY_REF</code> </dt> <dd> <p>Colon-delimited list of refs or globs indicating which refs, in addition to the default from <code>core.notesRef</code> or <code>GIT_NOTES_REF</code>, to read notes from when showing commit messages. This overrides the <code>notes.displayRef</code> setting.</p> <div class="paragraph"> <p>A warning will be issued for refs that do not exist, but a glob that does not match any refs is silently ignored.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codeGITNOTESREWRITEMODEcode"> <a class="anchor" href="#Documentation/git-notes.txt-codeGITNOTESREWRITEMODEcode"></a><code>GIT_NOTES_REWRITE_MODE</code> </dt> <dd> <p>When copying notes during a rewrite, what to do if the target commit already has a note. Must be one of <code>overwrite</code>, <code>concatenate</code>, <code>cat_sort_uniq</code>, or <code>ignore</code>. This overrides the <code>core.rewriteMode</code> setting.</p> </dd> <dt class="hdlist1" id="Documentation/git-notes.txt-codeGITNOTESREWRITEREFcode"> <a class="anchor" href="#Documentation/git-notes.txt-codeGITNOTESREWRITEREFcode"></a><code>GIT_NOTES_REWRITE_REF</code> </dt> <dd> <p>When rewriting commits, which notes to copy from the original to the rewritten commit. Must be a colon-delimited list of refs or globs.</p> <div class="paragraph"> <p>If not set in the environment, the list of notes to copy depends on the <code>notes.rewrite.<command></code> and <code>notes.rewriteRef</code> settings.</p> </div> </dd> </dl> </div> </div> </div> <div class="sect1"> <h2 id="_git"><a class="anchor" href="#_git"></a>GIT</h2> <div class="sectionbody"> <div class="paragraph"> <p>Part of the <a href='/docs/git'>git[1]</a> suite</p> </div> </div> </div> <div id="footnotes"> <hr> <div class="footnote" id="_footnotedef_1"> <a href="#_footnoteref_1">1</a>. Permitted pathnames have the form <em>bf</em><code>/</code><em>fe</em><code>/</code><em>30</em><code>/</code><em>…​</em><code>/</code><em>680d5a…​</em>: a sequence of directory names of two hexadecimal digits each followed by a filename with the rest of the object ID. </div> </div> <h3 hidden="true" data-pagefind-weight="10">notes</h3> </div> </div> </div> <footer> <div class="site-source"> <a href="/site">About this site</a><br> Patches, suggestions, and comments are welcome. </div> <div class="sfc-member"> Git is a member of <a href="/sfc">Software Freedom Conservancy</a> </div> </footer> <a href="#top" class="no-js scrollToTop" id="scrollToTop" data-label="Scroll to top"> <img src="/images/icons/chevron-up@2x.png" width="20" height="20" alt="scroll-to-top"/> </a> <script src="/js/jquery-1.7.1.min.js"></script> <script src="/js/jquery-ui-1.8.18.custom.min.js"></script> <script src="/js/jquery.defaultvalue.js"></script> <script src="/js/session.min.js"></script> <script src="/js/modernizr.js"></script> <script src="/js/modernize.js"></script> <script src="/js/application.min.js"></script> </div> </body> </html>