我正在尝试git push
在 crontab 运行的 bash 脚本中使用以将提交推送到 github。在脚本的最后,我这样做:
# script processes some files, then:
git add -A
git commit -a -m "Updated $(date)"
git push origin master
Run Code Online (Sandbox Code Playgroud)
添加和提交工作正常(当从 CL 运行脚本时推送工作正常,而不是使用 cron),但我在使用 cron 推送到 github 时出错:
git: 'credential-osxkeychain' is not a git command. See 'git --help'.
fatal: could not read Username for 'https://github.com': Device not configured
Run Code Online (Sandbox Code Playgroud)
我已经搜索了其他线程(如this和this),但它似乎不是 SSH 的问题(至少我尝试在 crontab 行中传递 SSH_AUTH_SOCK 环境变量,但没有奏效)。运行 OSX 10.8。
有任何想法吗?