GIT clone over http failed (curl result = 22, http_code 401)

Mac OS X 10.6.6 Server git client and server version: 1.7.3.5

Error returned:

Chris-Muenchs-Mac-Book-Pro:Desktop cmuench$ git clone http://example.com/is.git Cloning into is... Username: Password: error: The requested URL returned error: 401 (curl_result = 22, http_code = 401, sha1 = 8fbb19449c4388ae4b51594af3507bfd44c567d7) error: Unable to find 8fbb19449c4388ae4b51594af3507bfd44c567d7 under http://example.com/is.git Cannot obtain needed commit 8fbb19449c4388ae4b51594af3507bfd44c567d7 while processing commit 129e0ba31589356b9c4326907ddf7e11d7b6be18. error: Fetch failed. 

The above commit sha1 link exists in the repo, and I can clone through the file system, but not through http or https.

Here are my apache settings: (WebDav enabled) (Defined above this snippet)

 <Location "/is.git"> AuthType Basic <Limit GET HEAD OPTIONS CONNECT POST PROPFIND PUT DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> Require group development </Limit> AuthName "is.git" </Location> 

Any ideas on how to fix this?

+4
source share
2 answers

The HTTP 403 that you see when you try to click is the code that indicates "Forbidden." You need to add:

 Order allow,deny Allow from all 

... to your Location block?

0
source

Overview

HTTP 401 means the request requires user authentication; refer to HTTP Status Codes .

Assuming you entered the correct username and password, a 401 response means that the credentials may not be sent correctly or the credentials may not be authenticated. Ignore this line.

Real problem

The next 3 lines indicate where the real problem is.

  error: Unable to find 8fbb19449c4388ae4b51594af3507bfd44c567d7 under http://example.com/is.git Cannot obtain needed commit 8fbb19449c4388ae4b51594af3507bfd44c567d7 while processing commit 129e0ba31589356b9c4326907ddf7e11d7b6be18. 

This means that some commits cannot be found on the server.

Elimination

Performing git cleanup git gc should fix the problem. Run git gc in the folder where the git repository is located, and this should fix the problem.

Greetings

+11
source

Source: https://habr.com/ru/post/1343070/


All Articles