Automated git push attempt does not work - authentication issue

Posted by at least three characters on Super User See other posts from Super User or by at least three characters
Published on 2013-10-22T03:03:14Z Indexed on 2013/10/22 3:57 UTC
Read the original article Hit count: 420

Filed under:
|
|
|
|

I'm trying to automate a very periodic git add/commit/push cycle using a shell script and cron under OS X 10.8.5. The script is as basic as one would expect it to be:

cd /my/directory
git add .
git commit -m "a commit message with the date"
git push -u origin master

I've tried running it both as root as well as a non-root user. When I do this manually, I get a dialog box from OS X requesting that I authenticate the operation.

Running the script (either using cron or just using sh) ends up sending a message (via mail) to whichever user's cron executed the script saying that it was unable to write a file in the .git directory because of a permissions issue (which is most likely manual execution requires authentication).

Is there any way to circumvent this issue, or give the script permission to perform this operation without having me intervene each time?

© Super User or respective owner

Related posts about osx

Related posts about permissions