git notes and github

66
GIT NOTES & GITHUB

Upload: matthew-mccullough

Post on 20-Feb-2017

1.037 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: Git Notes and GitHub

GIT NOTES & GITHUB

Page 2: Git Notes and GitHub

GIT NOTES & GITHUBA Parallel Message Set

Page 3: Git Notes and GitHub

Notes

Page 4: Git Notes and GitHub
Page 5: Git Notes and GitHub

• Object pointing to a commit

• Supplemental to commit messages

• Namespaced for grouping of notes

Page 6: Git Notes and GitHub

• Object pointing to a commit

• Supplemental to commit messages

• Namespaced for grouping of notes

Page 7: Git Notes and GitHub

• Object pointing to a commit

• Supplemental to commit messages

• Namespaced for grouping of notes

Page 8: Git Notes and GitHub
Page 9: Git Notes and GitHub

— Git notes man page

A typical use of notes is to supplement a commit message without changing the commit itself.

Page 10: Git Notes and GitHub

The Basics

Page 11: Git Notes and GitHub

GIT-NOTES(1) Git Manual GIT-NOTES(1)

NAME git-notes - Add or inspect object notes

SYNOPSIS git notes [list [<object>]] git notes add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes copy [-f] ( --stdin | <from-object> <to-object> ) git notes append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes edit [<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

Page 12: Git Notes and GitHub

GIT-NOTES(1) Git Manual GIT-NOTES(1)

NAME git-notes - Add or inspect object notes

SYNOPSIS git notes [list [<object>]] git notes add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes copy [-f] ( --stdin | <from-object> <to-object> ) git notes append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes edit [<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

Page 13: Git Notes and GitHub

Create a note

Page 14: Git Notes and GitHub

$ git notes add -m”<SOMENOTEMESSAGE>”

Page 15: Git Notes and GitHub

Video

Page 16: Git Notes and GitHub

Examine the directory structure

Page 17: Git Notes and GitHub

$ tree .git/refs/notes

Page 18: Git Notes and GitHub

Video

Page 19: Git Notes and GitHub

Displaying notes

Page 20: Git Notes and GitHub

$ git notes show <COMMIT>

Page 21: Git Notes and GitHub

Video

Page 22: Git Notes and GitHub

$ git log <COMMIT>

Page 23: Git Notes and GitHub

Video

Page 24: Git Notes and GitHub

Namespacing

Page 25: Git Notes and GitHub

Default namespace is commits

Page 26: Git Notes and GitHub

$ git notes --ref <OTHERREF> add -m”<SOMENOTEMESSAGE>”

Page 27: Git Notes and GitHub

Video

Page 28: Git Notes and GitHub

Viewing a different namespace

Page 29: Git Notes and GitHub

$ git notes --ref jenkins show <COMMIT>

Page 30: Git Notes and GitHub

Video

Page 31: Git Notes and GitHub

$ git log --show-notes=jenkins

Page 32: Git Notes and GitHub

Video

Page 33: Git Notes and GitHub

$ git log --show-notes=*

Page 34: Git Notes and GitHub

Video

Page 35: Git Notes and GitHub

Pushing

Page 36: Git Notes and GitHub

Notes don’t push by default

Page 37: Git Notes and GitHub

git push origin refs/notes/commits

// orgit push origin refs/notes/jenkins

// orgit push origin refs/notes/*

Page 38: Git Notes and GitHub

Video

Page 39: Git Notes and GitHub

$ git config --global alias.pushnotes "\!sh -c 'git push \$1 refs/notes/*' -"

$ git pushnotes origin

Page 40: Git Notes and GitHub

Fetching

Page 41: Git Notes and GitHub

Notes don’t fetch by default

Page 42: Git Notes and GitHub

$ git fetch origin refs/notes/commits:refs/notes/commits

// or$ git fetch origin refs/notes/jenkins:refs/notes/jenkins

// or$ git fetch origin refs/notes/*:refs/notes/*

Page 43: Git Notes and GitHub

Video

Page 44: Git Notes and GitHub

$ git config --global alias.fetchnotes\ "\!sh -c 'git fetch \$1 refs/notes/*:refs/notes/*' -"

Page 45: Git Notes and GitHub

$ vim .git/config

...and edit

[remote ”origin”] fetch = +refs/heads/*:refs/remotes/origin/*

...to be

[remote ”origin”] fetch = +refs/heads/*:refs/remotes/origin/* fetch = +refs/notes/*:refs/notes/*

Page 46: Git Notes and GitHub

GitHub

Page 47: Git Notes and GitHub

Notes are shown with commits

Page 48: Git Notes and GitHub

Video

Page 49: Git Notes and GitHub

More?

Page 50: Git Notes and GitHub

Notes can be appended

Page 51: Git Notes and GitHub

GIT-NOTES(1) Git Manual GIT-NOTES(1)

NAME git-notes - Add or inspect object notes

SYNOPSIS git notes [list [<object>]] git notes add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes copy [-f] ( --stdin | <from-object> <to-object> ) git notes append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes edit [<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

Page 52: Git Notes and GitHub

GIT-NOTES(1) Git Manual GIT-NOTES(1)

NAME git-notes - Add or inspect object notes

SYNOPSIS git notes [list [<object>]] git notes add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes copy [-f] ( --stdin | <from-object> <to-object> ) git notes append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes edit [<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

Page 53: Git Notes and GitHub
Page 54: Git Notes and GitHub

Notes can be merged

Page 55: Git Notes and GitHub

GIT-NOTES(1) Git Manual GIT-NOTES(1)

NAME git-notes - Add or inspect object notes

SYNOPSIS git notes [list [<object>]] git notes add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes copy [-f] ( --stdin | <from-object> <to-object> ) git notes append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes edit [<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

Page 56: Git Notes and GitHub

GIT-NOTES(1) Git Manual GIT-NOTES(1)

NAME git-notes - Add or inspect object notes

SYNOPSIS git notes [list [<object>]] git notes add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes copy [-f] ( --stdin | <from-object> <to-object> ) git notes append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes edit [<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

Page 57: Git Notes and GitHub
Page 58: Git Notes and GitHub

Notes can be removed

Page 59: Git Notes and GitHub

GIT-NOTES(1) Git Manual GIT-NOTES(1)

NAME git-notes - Add or inspect object notes

SYNOPSIS git notes [list [<object>]] git notes add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes copy [-f] ( --stdin | <from-object> <to-object> ) git notes append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes edit [<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

Page 60: Git Notes and GitHub

GIT-NOTES(1) Git Manual GIT-NOTES(1)

NAME git-notes - Add or inspect object notes

SYNOPSIS git notes [list [<object>]] git notes add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes copy [-f] ( --stdin | <from-object> <to-object> ) git notes append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] git notes edit [<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

Page 61: Git Notes and GitHub

Resources

Page 63: Git Notes and GitHub

https://github.com/blog/707-git-notes-display

Page 64: Git Notes and GitHub

Useful?

Page 65: Git Notes and GitHub
Page 66: Git Notes and GitHub

GIT NOTES & GITHUBA Parallel Message Set