#!/bin/bash # This is an example script that can be used in conjunction with the # on_modification config option to commit every note change to a git # repository. You'll need to place it somewhere on your $PATH. This # script assumes that your state_dir is also a git repository. set -e COMMIT_MESSAGE="automated commit ($HOSTNAME)" STATE_DIR="$(note config get state_dir)" GIT_DIR="$STATE_DIR/.git" WORK_DIR="$STATE_DIR" GIT="git --git-dir=$GIT_DIR --work-tree=$WORK_DIR" $GIT add --all $GIT commit -m "$COMMIT_MESSAGE"