Skip to content

How to access a GIT repository over authenticated HTTP

Hi

My second headache for today was brought by GIT. I have a simple Apache server providing a restricted access (basic HTTP authentication) on a GIT repository.

From my local terminal, I just wanted to access the repository using:
git clone http://myhost.com/path/to/repository/.git
It asks for credentials (both user name and password), and fails miserably with a 401 error after entering them.

Well the problem is solved by just specifying the user name in the URL:
git clone http://myuser@myhost.com/path/to/repository/.git
This way it asks for just the password, and works like a charm.

Seems like a bug to me :-/

Muriel

Leave a Reply

Your email address will not be published. Required fields are marked *