嘿,我正在尝试使用 Mac 上的 cron 作业将代码推送到 git。我使用编辑 crontabcrontab -e并在其中包含以下内容:
* 12 * * 1 ~/Dropbox/MD/sync.sh
* 12 * * 5 ~/Dropbox/MD/sync.sh
Run Code Online (Sandbox Code Playgroud)
脚本如下:
#!/bin/bash
cd ~/Dropbox/MD
/usr/bin/git add .
/usr/bin/git commit -m "Docs auto update"
/usr/bin/git push origin master
Run Code Online (Sandbox Code Playgroud)
但是该命令失败,当我运行时,mail我可以检查错误消息:fatal: could not read Username for 'https://github.com': Device not configured。我该如何解决这个问题?如果我从终端手动运行命令,则不会出现任何问题,也不会提示我输入用户凭据。
对此的任何指示将不胜感激。谢谢!