Posted comments (4)

Posted by Averias at February 18, 2013 15:58:24 UTC
Very good tutorial!!

I followed all steps but in the last one "git push origin master" I got:

Fetching remote heads...
refs/
refs/heads/
refs/tags/
updating 'refs/heads/master'
from 0000000000000000000000000000000000000000
to 142db43d8dbf3df1e370a5f0c1599971e51ebc80
Unable to lock remote branch refs/heads/master
Updating remote server info
PUT error: curl result=22, HTTP code=403
fatal: git-http-push failed

My log file:

Mon Feb 18 15:07:15 2013] [error] [client 192.168.1.78] Could not save .locknull file. [500, #0]
[Mon Feb 18 15:07:15 2013] [error] [client 192.168.1.78] (2)No such file or directory: Error opening /Applications/MAMP/htdocs/git/hola.git/refs/heads/.DAV/.locknull for writing [500, #0]
[Mon Feb 18 15:07:15 2013] [error] [client 192.168.1.78] Unable to PUT new contents for /hola.git/info/refs. [403, #0]
[Mon Feb 18 15:07:15 2013] [error] [client 192.168.1.78] (13)Permission denied: An error occurred while opening a resource. [500, #0]
[Mon Feb 18 15:07:49 2013] [error] [client 192.168.1.78] Could not LOCK /hola.git/refs/heads/master due to a failed precondition (e.g. other locks). [423, #0]
[Mon Feb 18 15:07:49 2013] [error] [client 192.168.1.78] (2)No such file or directory: Existing lock(s) on the requested resource prevent an exclusive lock. [423, #0]
[Mon Feb 18 15:07:49 2013] [error] [client 192.168.1.78] Unable to PUT new contents for /hola.git/info/refs. [403, #0]
[Mon Feb 18 15:07:49 2013] [error] [client 192.168.1.78] (13)Permission denied: An error occurred while opening a resource. [500, #0]

I'm on Mac Lion server 10.7.5 for server repository and Ma Mountain Lion for client repository.

Can you help me, please!?

Thank you very much
Posted by Sanjeev G at September 4, 2013 05:03:36 UTC
Hi,

I am also experiencing same issue as stated by Averias (above) .
Any update on resolving this ?

Regards
Sanjeev
Posted by Pankaj Chhabra at March 15, 2014 17:26:08 UTC
Thanks author for an excellent article.
To fix the curl issue here is what you can do

$cd /Library/WebServer/Documents
$sudo chown -R _www:_www gitprojects

This will fix it.
Posted by Pankaj Chhabra at March 18, 2014 05:27:33 UTC
I have created the script for directory creation. this could be passed a parameter also. Here it is creating scm.git

sudo mkdir -p /Library/WebServer/Documents/gitprojects
cd /Library/WebServer/Documents/gitprojects
sudo mkdir scm.git
cd scm.git/
sudo git --bare init
cd hooks/
sudo cp post-update.sample post-update
cd /Library/WebServer/Documents/gitprojects
sudo chown -R _www:_www scm.git/
cd scm.git/hooks/
sudo -u _www ./post-update
sudo git --bare update-server-info
cd ..
sudo git --bare update-server-info
cd /Library/WebServer/Documents/
sudo chown -R _www:_www gitprojects
sudo apachectl restart
~