DEV Community

Cover image for Serving a Git repository over HTTP

Serving a Git repository over HTTP

Mohammad Altaleb on May 13, 2019

A while ago, I was assigned the task of researching how to serve a Git repository over HTTP. The tutorials and documentations I've found were eithe...
Collapse
 
jvleminc profile image
Joris Vleminckx • Edited

Thanks for this tutorial. I managed to clone the repo without entering username/password, but when pushing no username/pasword is requested, an error occurs:

jvleminckx@joris-laptopWork  ~/reponame   master  git push -u origin master
error: Cannot access URL 198.204.227.93/git/reponame/, return code 22
fatal: git-http-push failed
error: failed to push some refs to '198.204.227.93/git/reponame/'

No credentials asked...

UPDATE: This happened because I hadn't commented out
IncludeOptional sites-enabled/*.conf

in /etc/apache2/apache2.conf. Once done this, the pushing started asking for credentials and the push worked fine.

Collapse
 
bloodtearvn profile image
bloodtearvn

Can you show conffig with php authentication connect mysql (each folder each permission)
Example:
Create 2 repository: pr1, pr2
Create 2 user: user1 user2
now i want only user1 can access pr1 and user2 can access pr2 and user or user can not access another

Collapse
 
swetha1592 profile image
swetha1592

Hi Can u please explain what is www-data here.
Is that an existing folder?

chgrp -R www-data /var/www/html/git
chown -R www-data /var/www/html/git

Collapse
 
jvleminc profile image
Joris Vleminckx

Be sure that apache has been installed after step 1: sudo apt-get install apache2 The user/group should be created by this installation.

Collapse
 
ashtyn3 profile image
Ashtyn

What are my user name and password? I didn't change them from the "hello", "world" in auth.sh script. And when I clone it keeps telling me my username and password are wrong?