Permission / owner issue with pushing to git when editing directly from repo?

Posted by Susan on Server Fault See other posts from Server Fault or by Susan
Published on 2010-04-27T06:38:54Z Indexed on 2010/04/27 6:43 UTC
Read the original article Hit count: 369

Filed under:
|
|

I have a web interface for deploying scripts from our repo at Github to our live server. The web interface just triggers a bash script with some git commands. If I make changes locally, push to repo, then run the bash script to pull from repo to live it works fine. However, if I make changes directly in the repo (via Github's web interface), I'm running into fast-forward / lock issues.

These are the steps I'm taking:

  1. Make a change on a file at Github repo
  2. Run a bash script (as apache) via web from live server that attempts a git push / pull. Get these problems:

    PUSH To [email protected]:name/name.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to '[email protected]:name/name.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.

    PULL From github.com:name/name branch master -> FETCH_HEAD error: unable to unlink old 'includes/footer.inc' (Permission denied) Updating 8f6d922..d1eba9d Updating 8f6d922..d1eba9d

  3. SSH in as root, attempt a push / pull and it works fine.

Ideas on why would this method not work from apache?

© Server Fault or respective owner

Related posts about git

Related posts about github