Skip to content

Instantly share code, notes, and snippets.

@tomvdv
Last active July 27, 2016 20:18
Show Gist options
  • Save tomvdv/9366956 to your computer and use it in GitHub Desktop.
Save tomvdv/9366956 to your computer and use it in GitHub Desktop.
CodeKit 2 hook: auto-commit changes to local git repo
# terminal-notifier available at https://github.com/alloy/terminal-notifier
PROJECT_PATH="/Users/username/Path/To/Project/"
GITFILE="$PROJECT_PATH.git"
if [ ! -e $GITFILE ]
then
cd $PROJECT_PATH && git init && git add . && git commit -m 'initial commit'
terminal-notifier -message "Created local git repo with initial commit" -title "CodeKit hook: git"
else
cd $PROJECT_PATH && git add -A && git commit -m 'auto-commit on save (via codekit hook)'
terminal-notifier -message "Auto-commited changes to git" -title "CodeKit hook: git"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment