Quantcast
Channel: Eureka! » Git
Viewing all articles
Browse latest Browse all 15

Gollum – Auto sync to git remote repository

$
0
0

Whenever you have edited any page on Gollum, it will committed to the local repository which is checked out on the server. These commits WILL NOT be pushed to the Git Server. Similarly any push to the Git server will not sync to the repository running Gollum as it won’t execute git pull neither.

You may think of using the Git post-commit hook to trigger the synchronization whenever a commit is done but Gollum run Grit as the Git adapter and Grit doesn’t support hook.

A workaround suggested by Rod Hilton is to setup a cronjob and keep running the git push and pull on the server running Gollum.

So add the following sync.sh to your Gollum project root.
sync.sh

#!/bin/sh

DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
(cd $DIR && git pull && git push)

 

Then setup the crontab to run the sync.sh every minute.

*/1 * * * * /<gollum_root>/sync.sh

 

Done =)

Reference: Absolutely No Machete Juggling – Personal Wiki using GitHub and Gollum on OS X


Filed under: Development Tools, Git Tagged: cron, Cron Job, Git, Gollum, Grit, Rod Hilton, Ruby

Viewing all articles
Browse latest Browse all 15

Latest Images

Trending Articles





Latest Images