Compare with setting up the git daemon, it might be simpler:
- For a public repository, put it on github
- For a private repository, configuring sshd / ssh is easy.
The problem also occurred once on my server.
There are two ways to use when a clone from git: // ... cannot work.
1, git by ssh, add the public key of the user to ~ / .ssh / authorized_keys, then the username / password is not required to access the repository:
git clone user@host :/path/to/git/repository/myproject.git
2, pust the repository in the web server access directory, for example
/var/www/git
Make sure that / var / www / is accessible, for example, it is installed as apache httpd doc root. This will allow the user to get at least.
source share