Documentation ¶
Overview ¶
Package notes git-notes - Add or inspect object notes.
SYNOPSIS ¶
Reference: https://git-scm.com/docs/git-notes
git notes [list [<object>]] git notes add [-f] [--allow-empty] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes copy [-f] ( --stdin | <from-object> [<to-object>] ) git notes append [--allow-empty] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes edit [--allow-empty] [<object>] 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
DESCRIPTION ¶
Adds, removes, or reads notes attached to objects, without touching the objects themselves.
By default, notes are saved to and read from refs/notes/commits, 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.
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. 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 (<refname>):" (or "Notes:" for refs/notes/commits).
Notes can also be added to patches prepared with git format-patch by using the --notes option. Such notes are added as a patch commentary after a three dash separator line.
To change which notes are shown by git log, see the "notes.displayRef" configuration in git-log[1].
See the "notes.rewrite.<command>" configuration for a way to carry notes across commands that rewrite commits.
Index ¶
- func Abort(g *types.Cmd)
- func Add(object string, opts ...types.Option) types.Option
- func AllowEmpty(g *types.Cmd)
- func Append(object string, opts ...types.Option) types.Option
- func Commit(g *types.Cmd)
- func Copy(opts ...types.Option) types.Option
- func DryRun(g *types.Cmd)
- func Edit(object string, opts ...types.Option) types.Option
- func File(value string) func(*types.Cmd)
- func Force(g *types.Cmd)
- func GetRef(_ ...types.Option) types.Option
- func IgnoreMissing(g *types.Cmd)
- func List(object string) types.Option
- func Merge(opts ...types.Option) types.Option
- func Message(msg string) func(*types.Cmd)
- func NotesRef(ref string) func(*types.Cmd)
- func Object(from, to string) func(*types.Cmd)
- func Prune(opts ...types.Option) types.Option
- func Quiet(g *types.Cmd)
- func ReeditMessage(object string) func(*types.Cmd)
- func Ref(value string) func(*types.Cmd)
- func Remove(object string, opts ...types.Option) types.Option
- func ReuseMessage(object string) func(*types.Cmd)
- func Show(object string) types.Option
- func Stdin(g *types.Cmd)
- func Strategy(value string) func(*types.Cmd)
- func Verbose(g *types.Cmd)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abort ¶
Abort Abort/reset an in-progress git notes merge, i.e. a notes merge with conflicts. This simply removes all files related to the notes merge. --abort
func Add ¶
Add notes for a given object (defaults to `HEAD`). usage: git notes add [<options>] [<object>]
-m, --message <message> note contents as a string -F, --file <file> note contents in a file -c, --reedit-message <object> reuse and edit specified note object -C, --reuse-message <object> reuse specified note object --allow-empty allow storing empty note -f, --force replace existing notes
func AllowEmpty ¶
AllowEmpty Allow an empty note object to be stored. The default behavior is to automatically remove empty notes. --allow-empty
func Append ¶
Append to the notes of an existing object (defaults to `HEAD`). Creates a new notes object if needed. usage: git notes append [<options>] [<object>]
-m, --message <message> note contents as a string -F, --file <file> note contents in a file -c, --reedit-message <object> reuse and edit specified note object -C, --reuse-message <object> reuse specified note object --allow-empty allow storing empty note
func Commit ¶
Commit Finalize an in-progress git notes merge. Use this option when you have resolved the conflicts that git notes merge stored in .git/NOTES_MERGE_WORKTREE. This amends the partial merge commit created by git notes merge (stored in .git/NOTES_MERGE_PARTIAL) by adding the notes in .git/NOTES_MERGE_WORKTREE. The notes ref stored in the .git/NOTES_MERGE_REF symref is updated to the resulting commit. --commit
func Copy ¶
Copy the notes for the first object onto the second object (defaults to `HEAD`). usage: git notes copy [<options>] <from-object> <to-object>
or: git notes copy --stdin [<from-object> <to-object>]... -f, --force replace existing notes --stdin read objects from stdin --for-rewrite <command> load rewriting config for <command> (implies --stdin)
func DryRun ¶
DryRun Do not remove anything; just report the object names whose notes would be removed. -n, --dry-run
func Edit ¶
Edit the notes for a given object (defaults to `HEAD`). usage: git notes edit [<object>]
-m, --message <message> note contents as a string -F, --file <file> note contents in a file -c, --reedit-message <object> reuse and edit specified note object -C, --reuse-message <object> reuse specified note object --allow-empty allow storing empty note
func File ¶
File Take the note message from the given file. Use - to read the note message from the standard input. Lines starting with # and empty lines other than a single line between paragraphs will be stripped out. -F <file>, --file=<file>
func Force ¶
Force When adding notes to an object that already has notes, overwrite the existing notes (instead of aborting). -f, --force
func GetRef ¶
GetRef Print the current notes ref. This provides an easy way to retrieve the current notes ref (e.g. from scripts). usage: git notes get-ref
func IgnoreMissing ¶
IgnoreMissing Do not consider it an error to request removing notes from an object that does not have notes attached to it. --ignore-missing
func Merge ¶
Merge the given notes ref into the current notes ref. usage: git notes merge [<options>] <notes-ref>
or: git notes merge --commit [<options>] or: git notes merge --abort [<options>]
General options
-v, --verbose be more verbose -q, --quiet be more quiet
Merge options
-s, --strategy <strategy> resolve notes conflicts using the given strategy (manual/ours/theirs/union/cat_sort_uniq)
Committing unmerged notes
--commit finalize notes merge by committing unmerged notes
Aborting notes merge resolution
--abort abort notes merge
func Message ¶
Message Use the given note message (instead of prompting). If multiple -m options are given, their values are concatenated as separate paragraphs. Lines starting with # and empty lines other than a single line between paragraphs will be stripped out. -m <msg>, --message=<msg>
func Prune ¶
Prune Remove all notes for non-existing/unreachable objects. usage: git notes prune [<options>]
-n, --dry-run do not remove, show only -v, --verbose report pruned notes
func ReeditMessage ¶
ReeditMessage Like -C, but with -c the editor is invoked, so that the user can further edit the note message. -c <object>, --reedit-message=<object>
func Ref ¶
Ref Manipulate the notes tree in <ref>. This overrides GIT_NOTES_REF and the "core.notesRef" configuration. The ref specifies the full refname when it begins with refs/notes/; when it begins with notes/, refs/ and otherwise refs/notes/ is prefixed to form a full name of the ref. --ref <ref>
func Remove ¶
Remove the notes for given objects (defaults to `HEAD`). usage: git notes remove [<object>]
--ignore-missing attempt to remove non-existent note is not an error --stdin read object names from the standard input
func ReuseMessage ¶
ReuseMessage Take the given blob object (for example, another note) as the note message. (Use git notes copy <object> instead to copy notes between objects.) -C <object>, --reuse-message=<object>
func Show ¶
Show the notes for a given object (defaults to `HEAD`). usage: git notes show [<object>]
func Stdin ¶
Stdin 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). --stdin
func Strategy ¶
Strategy When merging notes, resolve notes conflicts using the given strategy. The following strategies are recognized: "manual" (default), "ours", "theirs", "union" and "cat_sort_uniq". This option overrides the "notes.mergeStrategy" configuration setting. See the "NOTES MERGE STRATEGIES" section below for more information on each notes merge strategy. -s <strategy>, --strategy=<strategy>
Types ¶
This section is empty.