I setup a ssh key for github account, so I don't have to enter the password every time, it works fine. Here is the script I use:
#!/bin/bash
git push origin master
But when I use cron to run it, it will not use my ssh key. Here is the output:
Permission denied (publickey)
fatal: The remote end hung up unexpectedly
I search around and found some articles, but none of them solve my problem. Here are the articles I found(and a lot more):
https://askubuntu.com/questions/110565/why-is-git-not-using-my-pubkey-with-crontab
https://unix.stackexchange.com/questions/35466/how-to-perform-git-push-using-crontab
Can anybody give me a step to step instructions to solve this problem?