Hey I am trying to push code to git using a cron job on the Mac. I edit my crontab using crontab -e
and have the following inside:
* 12 * * 1 ~/Dropbox/MD/sync.sh
* 12 * * 5 ~/Dropbox/MD/sync.sh
The script is as follows:
#!/bin/bash
cd ~/Dropbox/MD
/usr/bin/git add .
/usr/bin/git commit -m "Docs auto update"
/usr/bin/git push origin master
However the command fails and when I run mail
I can check the error message which is: fatal: could not read Username for 'https://github.com': Device not configured
. How can I fix this issue? If I run the commands manually from the terminal I have no issues and I am not prompted for user credentials.
Any pointers on this would be much appreciated. Thanks!