Skip to content

Instantly share code, notes, and snippets.

@ptb
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptb/b59c63cfdb71678d3d00 to your computer and use it in GitHub Desktop.
Save ptb/b59c63cfdb71678d3d00 to your computer and use it in GitHub Desktop.
Commit All File Changes to Git Repository, Automatically
#!/bin/sh
/usr/bin/find . -type d -empty -exec touch {}/.keep \;
/usr/local/bin/git add --all /Users/ptb/Copy/; /usr/local/bin/git commit --message='' --allow-empty-message
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>me.ptb2.autogit</string>
<key>ProgramArguments</key>
<array>
<string>/Users/ptb/Copy/commit.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WatchPaths</key>
<array>
<string>/Users/ptb/Copy</string>
</array>
<key>WorkingDirectory</key>
<string>/Users/ptb/Copy</string>
</dict>
</plist>
#!/bin/sh
/usr/local/bin/git push --set-upstream origin --all
/usr/local/bin/git push --set-upstream origin --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment