1 # returns true if the argument provided directory is a git repository
6 if git rev-parse
2>/dev
/null
; then
14 # sync local repository to remote
16 echo "Syncing notes with git on remote \"$GITREMOTE\""
21 # check for USEGIT and subsequent variables
22 if [[ $USEGIT && -n $GITREMOTE ]]; then
24 if ! is_git_repo
$BASEDIR; then
25 # initializing git repository
28 echo "adding all files to git"
30 $GIT commit
-m "$(basename $0) - initial commit"
31 $GIT remote add origin
$GITREMOTE
32 $GIT push
-u origin master
34 elif [[ $USEGIT && -z $GITREMOTE ]]; then
35 echo "GITREMOTE variable not set. reverting USEGIT to false"