This gist shows the steps to automatically git commit changes under a folder of interest to your github.
Create a repo on github for the folder of interest and intialize the folder as a git repo by git init
Create a subfolder (say scripts) and download the aut-commit.sh to that folder.
cd /path/to/the/folder/of/interest
mkdir scripts # create a subfolder
cd scripts && wget https://gist.githubusercontent.com/litanlitudan/935cc3bb4bd79101f44ce7551004cfcb/raw/901631a309ad0cb2b7d25aa2aac77710a6143f3a/auto-commit.sh # download aut-commit.sh to the folder
Sanity check: The folder's structure should look like this
folder_of_interest
├── .git
├── file_of_interest.cpp
├── file_of_interest.md
├── file_of_interest.py
├── file_of_interest.txt
└── scripts
└── auto-commit.sh
Add the following line to your crontab
*/5 * * * * /path/to/the/folder/of/interest/scripts/auto-commit.sh >/dev/null 1>&1
To open the crontab in macOS, use crontab -e
in the terminal
Caveat: /path/to/the/folder/of/interest
needs to be absolute path which starts with /
Now all changes under /path/to/the/folder/of/interest
will be autoamtically committed and pushed to github every 5 minutes.