{"thread":{"id":"35084","subject":"Error in creating git over http","startedAt":"2013-10-08T15:05:22Z","lastAt":"2013-10-10T05:25:42Z","messageCount":3,"participants":["Shlomit Afgin","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"228614","messageId":"51123DD1BF2E03418A1296748DA730927454504A@ibwmbx03","threadId":"35084","inReplyTo":"51123DD1BF2E03418A1296748DA730927454460F@ibwmbx03","subject":"Error in creating git over http","fromName":"Shlomit Afgin","fromEmail":"shlomit.afgin@weizmann.ac.il","sentAt":"2013-10-08T15:05:22Z","receivedAt":"2013-10-08T15:05:22Z","isPatch":false,"sender":{"key":"shlomit.afgin@weizmann.ac.il","avatar":null},"body":"\nI'm trying to set a http git server.\n\nI do the following on the git server:\n       cd /var/www/html/\ngit clone --bare  /path/to/dir/ gitproject.git\ncd gitproject.git/\nmv hooks/post-update.sample hooks/post-update\nchmod a+x hooks/post-update\n\non the local machine run:\ngit clone http://server.name/gitproject.git\n\nI got the error:\n\"Initialized empty Git repository in /local/path/gitproject/.git/\nfatal: http://server.name/gitproject.git/info/refs not found: did you run\ngit update-server-info on the server?\"\n\n\nI saw that the file does not exist,  it seem that the file post-update is\nnot execute.\n\nI run it on the git server:\ngit update-server-info\n\nNow the info/ref is created.\n\nOn local machine I run again :\ngit clone http://server.name/gitproject.git\n\nNow I get the error:\n  Initialized empty Git repository in /local/path/gitproject/.git/\nerror: The requested URL returned error: 403 (curl_result = 22, http_code\n= 403, sha1 = 9d83b83df9fbc75ecd754264f95793fca93ccf93)\nerror: Unable to find 9d83b83df9fbc75ecd754264f95793fca93ccf93 under\nhttp://server.name/gitproject.git\nCannot obtain needed object 9d83b83df9fbc75ecd754264f95793fca93ccf93\n\n\nWhat I'm doing wrong?\nAny ideas are welcome.\nThanks.\n"},{"id":"228678","messageId":"20131010010616.GA14429@sigill.intra.peff.net","threadId":"35084","inReplyTo":"51123DD1BF2E03418A1296748DA730927454504A@ibwmbx03","subject":"Re: Error in creating git over http","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-10-10T01:06:17Z","receivedAt":"2013-10-10T01:06:17Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 08, 2013 at 03:05:22PM +0000, Shlomit Afgin wrote:\n\n> I do the following on the git server:\n>        cd /var/www/html/\n> git clone --bare  /path/to/dir/ gitproject.git\n> cd gitproject.git/\n> mv hooks/post-update.sample hooks/post-update\n> chmod a+x hooks/post-update\n\nOK, so on the next push, the info/refs file should be updated. Note that\nthis file is only necessary if you want to run the \"dumb\" http protocol\n(i.e., the less efficient one that does not require git on the server).\n\nYou didn't say whether you are trying to set up a \"dumb\" or \"smart\"\ngit-http server. These days you almost certainly want to set up a\n\"smart\" one, and you do not need to care about info/refs or running\nupdate-server-info.\n\n> on the local machine run:\n> git clone http://server.name/gitproject.git\n> \n> I got the error:\n> \"Initialized empty Git repository in /local/path/gitproject/.git/\n> fatal: http://server.name/gitproject.git/info/refs not found: did you run\n> git update-server-info on the server?\"\n> \n> I saw that the file does not exist,  it seem that the file post-update is\n> not execute.\n\nYes, if you didn't push yet, then it won't have been created.\n\n> I run it on the git server:\n> git update-server-info\n> \n> Now the info/ref is created.\n\nOK, good.\n\n> On local machine I run again :\n> git clone http://server.name/gitproject.git\n> \n> Now I get the error:\n>   Initialized empty Git repository in /local/path/gitproject/.git/\n> error: The requested URL returned error: 403 (curl_result = 22, http_code\n> = 403, sha1 = 9d83b83df9fbc75ecd754264f95793fca93ccf93)\n> error: Unable to find 9d83b83df9fbc75ecd754264f95793fca93ccf93 under\n> http://server.name/gitproject.git\n> Cannot obtain needed object 9d83b83df9fbc75ecd754264f95793fca93ccf93\n\n403 is an HTTP \"Forbidden\". Have you configured your web server to allow\naccess to the project? Have you marked the repository as\ngit-daemon-export-ok, as described in \"git help http-backend\" (or set\nGIT_HTTP_EXPORT_ALL in the environment)? Is there anything interesting\nin the webserver's error logs?\n\nIf it is still not working after checking those things, can you show us\nhow you have configured your webserver (presumably apache?).\n\n-Peff\n"},{"id":"228683","messageId":"51123DD1BF2E03418A1296748DA730927454C9B2@ibwmbx03","threadId":"35084","inReplyTo":"20131010010616.GA14429@sigill.intra.peff.net","subject":"Re: Error in creating git over http","fromName":"Shlomit Afgin","fromEmail":"shlomit.afgin@weizmann.ac.il","sentAt":"2013-10-10T05:25:42Z","receivedAt":"2013-10-10T05:25:42Z","isPatch":false,"sender":{"key":"shlomit.afgin@weizmann.ac.il","avatar":null},"body":"\nThanks for your answer.\n\nI did not know about \"dumb\" and \"smart\" I will read on those in the future.\n\nI found in google that the problem of Error: 403 can be solved.\nI run on the git server, in the directory that had the repository: 'git\ngc' which do git cleanup and the problem solved.\n\nThanks you very much.\n\n\n\n\nOn 10/10/13 3:06 AM, \"Jeff King\" <peff@peff.net> wrote:\n\n>On Tue, Oct 08, 2013 at 03:05:22PM +0000, Shlomit Afgin wrote:\n>\n>> I do the following on the git server:\n>>        cd /var/www/html/\n>> git clone --bare  /path/to/dir/ gitproject.git\n>> cd gitproject.git/\n>> mv hooks/post-update.sample hooks/post-update\n>> chmod a+x hooks/post-update\n>\n>OK, so on the next push, the info/refs file should be updated. Note that\n>this file is only necessary if you want to run the \"dumb\" http protocol\n>(i.e., the less efficient one that does not require git on the server).\n>\n>You didn't say whether you are trying to set up a \"dumb\" or \"smart\"\n>git-http server. These days you almost certainly want to set up a\n>\"smart\" one, and you do not need to care about info/refs or running\n>update-server-info.\n>\n>> on the local machine run:\n>> git clone http://server.name/gitproject.git\n>> \n>> I got the error:\n>> \"Initialized empty Git repository in /local/path/gitproject/.git/\n>> fatal: http://server.name/gitproject.git/info/refs not found: did you\n>>run\n>> git update-server-info on the server?\"\n>> \n>> I saw that the file does not exist,  it seem that the file post-update\n>>is\n>> not execute.\n>\n>Yes, if you didn't push yet, then it won't have been created.\n>\n>> I run it on the git server:\n>> git update-server-info\n>> \n>> Now the info/ref is created.\n>\n>OK, good.\n>\n>> On local machine I run again :\n>> git clone http://server.name/gitproject.git\n>> \n>> Now I get the error:\n>>   Initialized empty Git repository in /local/path/gitproject/.git/\n>> error: The requested URL returned error: 403 (curl_result = 22,\n>>http_code\n>> = 403, sha1 = 9d83b83df9fbc75ecd754264f95793fca93ccf93)\n>> error: Unable to find 9d83b83df9fbc75ecd754264f95793fca93ccf93 under\n>> http://server.name/gitproject.git\n>> Cannot obtain needed object 9d83b83df9fbc75ecd754264f95793fca93ccf93\n>\n>403 is an HTTP \"Forbidden\". Have you configured your web server to allow\n>access to the project? Have you marked the repository as\n>git-daemon-export-ok, as described in \"git help http-backend\" (or set\n>GIT_HTTP_EXPORT_ALL in the environment)? Is there anything interesting\n>in the webserver's error logs?\n>\n>If it is still not working after checking those things, can you show us\n>how you have configured your webserver (presumably apache?).\n>\n>-Peff\n"}]}