This is my first time I create a git server. I create a git https server with Nginx as a webserver, fcgiwrap as interface to the git-http-backend, and apache2-utils to generate the password hash for authentication.
Here is my git config:
[core]
repositoryformatversion = 0
filemode = true
bare = true
sharedrepository = 1
[receive]
denyNonFastforwards = true
[http]
receivepack = true
And here is my nginx config:
server {
listen 80;
server_name git.mydomain.com;
# This is where the repositories live on the server
root /srv/git;
location ~ (/.*) {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.gitpasswd;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
# export all repositories under GIT_PROJECT_ROOT
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT /srv/git;
fastcgi_param PATH_INFO $1;
}
}
How to configure an open-source git repository to not need username and password when clone and pull? and is there anything else I should pay attention to in the git config for the open source repository?