Posted comments (7)

Posted by Averias at February 18, 2013 15:58:24 CET
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 CEST
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 CET
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 CET
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
~
Posted by Daryl Spitzer at January 15, 2015 23:57:15 CET
Apache wasn't working for me (on OS X 10.10.1) after I created /etc/apache2/other/gitprojects.conf.

Running `sudo apachectl -t` told me (in a more detailed message that I didn't save): "Invalid command 'DavLockDB'".

After quite a bit of searching, I eventually found the following lines were commented out in /etc/apache2/httpd.conf:


LoadModule dav_module libexec/apache2/mod_dav.so
...
LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so
LoadModule dav_lock_module libexec/apache2/mod_dav_lock.so


I uncommented them it Apache then worked.

----

This blog post was extremely useful for me. Thank you.
Posted by Vc at September 24, 2015 22:08:57 CEST
I am getting Forbidden

You don't have permission to access /.... on this server.
Posted by Richar16 at October 2, 2015 14:43:08 CEST
Excellent article.

This blog post was extremely useful for me. Thank you.