【发布时间】:2019-08-24 20:42:31
【问题描述】:
嘿,我正在尝试使用 Mac 上的 cron 作业将代码推送到 git。我使用crontab -e 编辑了我的 crontab,并在里面有以下内容:
* 12 * * 1 ~/Dropbox/MD/sync.sh
* 12 * * 5 ~/Dropbox/MD/sync.sh
脚本如下:
#!/bin/bash
cd ~/Dropbox/MD
/usr/bin/git add .
/usr/bin/git commit -m "Docs auto update"
/usr/bin/git push origin master
但是命令失败,当我运行mail 时,我可以检查错误消息:fatal: could not read Username for 'https://github.com': Device not configured。我该如何解决这个问题?如果我从终端手动运行命令,我没有问题,也不会提示我输入用户凭据。
对此的任何指示将不胜感激。谢谢!
【问题讨论】: