Skip to content

Instantly share code, notes, and snippets.

@sehe
Created April 30, 2014 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sehe/70ee9931a875ec40f803 to your computer and use it in GitHub Desktop.
Save sehe/70ee9931a875ec40f803 to your computer and use it in GitHub Desktop.
using notes to provide pull-notifications
demo:/tmp$ mkdir DEMO && cd DEMO && git init . && touch a && git add a && git commit -am 'initial'
Initialized empty Git repository in /tmp/DEMO/.git/
[master (root-commit) 29fa231] initial
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a
demo:/tmp/DEMO$ for a in first second third fourth fifth sixth; do echo $a>a; git commit -am "$a commit"; done
[master 6cca37e] first commit
1 file changed, 1 insertion(+)
[master 676ba7b] second commit
1 file changed, 1 insertion(+), 1 deletion(-)
[master e1026f5] third commit
1 file changed, 1 insertion(+), 1 deletion(-)
[master 80e0ccf] fourth commit
1 file changed, 1 insertion(+), 1 deletion(-)
[master f01839b] fifth commit
1 file changed, 1 insertion(+), 1 deletion(-)
[master 745a335] sixth commit
1 file changed, 1 insertion(+), 1 deletion(-)
demo:/tmp/DEMO$ git notes add 6cca37e -m 'Starting from this version, make sure
>
> - you add bla to your local .gitignore
> - you use merge policy "ours" for all files in /config/dev/ (edit your
> .gitattributes)
> '
demo:/tmp/DEMO$ git notes add f01839b -m 'random note'
demo:/tmp/DEMO$ git checkout -b fake_remote 29fa231
Switched to a new branch 'fake_remote'
demo:/tmp/DEMO$ git log --oneline
29fa231 initial
demo:/tmp/DEMO$ git pull . master
From .
* branch master -> FETCH_HEAD
Updating 29fa231..745a335
Fast-forward
a | 1 +
1 file changed, 1 insertion(+)
demo:/tmp/DEMO$ git rev-list HEAD@{1}...FETCH_HEAD | while read sha1; do echo "$(git describe --always $sha1): $(git notes show $sha1 2>/dev/null)"; done
745a335:
f01839b: random note
80e0ccf:
e1026f5:
676ba7b:
6cca37e: Starting from this version, make sure
- you add bla to your local .gitignore
- you use merge policy "ours" for all files in /config/dev/ (edit your
.gitattributes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment