Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I use git and surround my note taking scripts with these two functions.

# Pull Notes to make sure you are completely up to date before editing.

function pull_notes() {

  (
    cd $NOTES_DIR
    git stash
    git pull
    git stash pop
  )
}

# Push Notes up the git repo that these are attached to.

function push_notes() {

  date=$(date)
  (
    cd $NOTES_DIR
    git add .
    if [[ $(git status -s) ]]; then
      git commit -m "Notes Updated: $date"
      git push
    fi
  )
}


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: