Auto sync GIT repos in MAC

Use the following to auto-commit your changes in git repo. The commit will include the file changed. You can control the monitor interval by changing the variable sleeptime in All the git operations are logged in /tmp/gitwatch-commit.log.

Use cases:

  • syncing your notes repository automatically eg. Sublime ZK



  • Make sure all the required softwares are installed
  • Place these 2 scripts in suitable folder
  • Change the repo and sleeptime as required.
  • Run the script on login via launchctl or automator.
  • Check if working via
    • tail -f /tmp/gitwatch-commit.log
    • bash -x


Back to Top ↑