Last active
July 27, 2016 20:18
-
-
Save tomvdv/9366956 to your computer and use it in GitHub Desktop.
CodeKit 2 hook: auto-commit changes to local git repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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