home
·
contact
·
privacy
projects
/
redo-blog
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ff5b37d
)
Extend remote git management recipe.
author
Christian Heller
<c.heller@plomlompom.de>
Mon, 2 Jan 2017 22:30:42 +0000
(23:30 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Mon, 2 Jan 2017 22:30:42 +0000
(23:30 +0100)
README.md
patch
|
blob
|
history
diff --git
a/README.md
b/README.md
index 822c08d594be5e0cc29b3e07acc2a3cdba68a2c4..49ad8b182217cb3dcf988d7218871b18144d09f8 100644
(file)
--- a/
README.md
+++ b/
README.md
@@
-49,10
+49,18
@@
called `blog`:
git init --bare blog.git
cat << EOF > blog.git/hooks/post-update
#!/bin/sh
git init --bare blog.git
cat << EOF > blog.git/hooks/post-update
#!/bin/sh
- BLOGDIR=~/blog
- GIT_WORK_TREE=\$BLOGDIR git checkout -f
- cd \$BLOGDIR
+ blog_dir=~/blog
+ export GIT_DIR=\$(pwd)
+ export GIT_WORK_TREE="\$blog_dir"
+ git checkout -f
+ cd "\$GIT_WORK_TREE"
redo
redo
+ git add metadata/author metadata/url metadata/title metadata/*.tmpl metadata/*.automatic_metadata metadata/automatic_metadata
+ status=\$(git status -s)
+ n_updates=\$(printf "$status" | grep -vE '^\?\?' | wc -l)
+ if [ "\$n_updates" -gt 0 ]; then
+ git commit -a -m 'Update metadata'
+ fi
EOF
chmod a+x blog.git/hooks/post-update
EOF
chmod a+x blog.git/hooks/post-update
@@
-81,6
+89,11
@@
replace the username `user` and the server name `example.org`):
git commit -m 'set up blog metadata'
git push origin master
git commit -m 'set up blog metadata'
git push origin master
+If successful, the git hook will furthermore commit some ~/blog/metadata/ files
+generated by redo, that can be pulled into the client-side local repository:
+
+ git pull origin master
+
bugs and peculiarities
----------------------
bugs and peculiarities
----------------------